	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pthread_cancel                 ## -- Begin function pthread_cancel
	.p2align	4, 0x90
_pthread_cancel:                        ## @pthread_cancel
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	xorl	%esi, %esi
	callq	_pthread_kill
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_15
## %bb.1:
	xorl	%eax, %eax
	callq	_pthread_self
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	%r15, %rdi
	movq	%rax, %rsi
	callq	_pthread_equal
	movl	%eax, %ebx
	leaq	24(%r15), %r14
	movq	%r14, %rdi
	callq	_pthread_mutex_lock
	movq	(%r15), %rax
	movq	_PTHREAD_CANCEL_ASYNCHRONOUS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.4:
	movq	8(%r15), %rax
	movq	_PTHREAD_CANCEL_ENABLE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.5:
	movq	_PThreadStateCanceling@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rax, 16(%r15)
	jge	LBB0_9
## %bb.6:
	testl	%ebx, %ebx
	je	LBB0_8
## %bb.7:
	movq	%rax, 16(%r15)
	movq	_PTHREAD_CANCEL_DISABLE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%r15)
	movq	%r14, %rdi
	callq	_pthread_mutex_unlock
	movq	_PTE_EPS_CANCEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_pte_throw
	xorl	%ebx, %ebx
	jmp	LBB0_15
LBB0_9:
	movq	16(%r15), %rax
	movq	_PThreadStateCancelPending@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rcx, %rax
	jge	LBB0_11
## %bb.10:
	movq	%rcx, 16(%r15)
	movl	28(%r15), %edi
	callq	_pte_osThreadCancel
	movq	_PTE_OS_OK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	sete	%al
	jmp	LBB0_12
LBB0_2:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_15
LBB0_11:
	movq	_PThreadStateCanceling@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	setl	%al
LBB0_12:
	xorl	%ebx, %ebx
	testb	%al, %al
	jne	LBB0_14
## %bb.13:
	movq	_ESRCH@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_14:
	movq	%r14, %rdi
	callq	_pthread_mutex_unlock
LBB0_15:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	%r14, %rdi
	callq	_pthread_mutex_unlock
	movq	_EPERM@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_PTHREAD_CANCEL_ASYNCHRONOUS,8,3 ## @PTHREAD_CANCEL_ASYNCHRONOUS
	.comm	_PTHREAD_CANCEL_ENABLE,8,3      ## @PTHREAD_CANCEL_ENABLE
	.comm	_PThreadStateCanceling,8,3      ## @PThreadStateCanceling
	.comm	_PTHREAD_CANCEL_DISABLE,8,3     ## @PTHREAD_CANCEL_DISABLE
	.comm	_PTE_EPS_CANCEL,4,2             ## @PTE_EPS_CANCEL
	.comm	_EPERM,4,2                      ## @EPERM
	.comm	_PThreadStateCancelPending,8,3  ## @PThreadStateCancelPending
	.comm	_PTE_OS_OK,8,3                  ## @PTE_OS_OK
	.comm	_ESRCH,4,2                      ## @ESRCH
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pthread_cancel                 ; -- Begin function pthread_cancel
	.p2align	2
_pthread_cancel:                        ; @pthread_cancel
	.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
	mov	w1, #0
	bl	_pthread_kill
	mov	x21, x0
	cbnz	w0, LBB0_12
; %bb.1:
	bl	_pthread_self
	cbz	x0, LBB0_9
; %bb.2:
	mov	x1, x0
	mov	x0, x20
	bl	_pthread_equal
	mov	x21, x0
	add	x19, x20, #24
	mov	x0, x19
	bl	_pthread_mutex_lock
	ldr	x8, [x20]
Lloh0:
	adrp	x9, _PTHREAD_CANCEL_ASYNCHRONOUS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PTHREAD_CANCEL_ASYNCHRONOUS@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.3:
	ldr	x8, [x20, #8]
Lloh3:
	adrp	x9, _PTHREAD_CANCEL_ENABLE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PTHREAD_CANCEL_ENABLE@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.4:
	ldr	x9, [x20, #16]
Lloh6:
	adrp	x8, _PThreadStateCanceling@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PThreadStateCanceling@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	cmp	x9, x8
	b.ge	LBB0_7
; %bb.5:
	cbz	w21, LBB0_13
; %bb.6:
Lloh9:
	adrp	x9, _PTHREAD_CANCEL_DISABLE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _PTHREAD_CANCEL_DISABLE@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	stp	x9, x8, [x20, #8]
	mov	x0, x19
	bl	_pthread_mutex_unlock
Lloh12:
	adrp	x8, _PTE_EPS_CANCEL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PTE_EPS_CANCEL@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	bl	_pte_throw
	mov	w21, #0
	b	LBB0_12
LBB0_7:
	ldr	x8, [x20, #16]
Lloh15:
	adrp	x9, _PThreadStateCancelPending@GOTPAGE
Lloh16:
	ldr	x9, [x9, _PThreadStateCancelPending@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_10
; %bb.8:
	str	x9, [x20, #16]
	ldr	w0, [x20, #28]
	bl	_pte_osThreadCancel
Lloh18:
	adrp	x8, _PTE_OS_OK@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PTE_OS_OK@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
	cmp	x0, x8
	cset	w8, eq
	b	LBB0_11
LBB0_9:
Lloh21:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh23:
	ldr	w21, [x8]
	b	LBB0_12
LBB0_10:
Lloh24:
	adrp	x9, _PThreadStateCanceling@GOTPAGE
Lloh25:
	ldr	x9, [x9, _PThreadStateCanceling@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w8, lt
LBB0_11:
Lloh27:
	adrp	x9, _ESRCH@GOTPAGE
Lloh28:
	ldr	x9, [x9, _ESRCH@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	cmp	w8, #0
	csel	w21, wzr, w9, ne
	mov	x0, x19
	bl	_pthread_mutex_unlock
LBB0_12:
	mov	x0, x21
	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
LBB0_13:
	mov	x0, x19
	bl	_pthread_mutex_unlock
Lloh30:
	adrp	x8, _EPERM@GOTPAGE
Lloh31:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
Lloh32:
	ldr	w21, [x8]
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PTHREAD_CANCEL_ASYNCHRONOUS,8,3 ; @PTHREAD_CANCEL_ASYNCHRONOUS
	.comm	_PTHREAD_CANCEL_ENABLE,8,3      ; @PTHREAD_CANCEL_ENABLE
	.comm	_PThreadStateCanceling,8,3      ; @PThreadStateCanceling
	.comm	_PTHREAD_CANCEL_DISABLE,8,3     ; @PTHREAD_CANCEL_DISABLE
	.comm	_PTE_EPS_CANCEL,4,2             ; @PTE_EPS_CANCEL
	.comm	_EPERM,4,2                      ; @EPERM
	.comm	_PThreadStateCancelPending,8,3  ; @PThreadStateCancelPending
	.comm	_PTE_OS_OK,8,3                  ; @PTE_OS_OK
	.comm	_ESRCH,4,2                      ; @ESRCH
.subsections_via_symbols
