	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ktp_worker
_ktp_worker:                            ## @ktp_worker
	.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), %rax
	movq	24(%rdi), %r12
	cmpq	(%r12), %rax
	jge	LBB0_21
## %bb.1:
	movq	%rdi, %rbx
	leaq	12(%r12), %r14
	leaq	16(%r12), %r15
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_2 Depth=1
	incq	%rax
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_18
## %bb.19:                              ##   in Loop: Header=BB0_2 Depth=1
	cqto
	idivq	%rcx
	movq	%rdx, %rcx
LBB0_20:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%rcx, (%rbx)
	movl	$0, 8(%rbx)
	movq	%r15, %rdi
	callq	_pthread_cond_broadcast
	movq	%r14, %rdi
	callq	_pthread_mutex_unlock
	movq	(%rbx), %rax
	cmpq	(%r12), %rax
	jge	LBB0_21
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_3 Depth 2
                                        ##       Child Loop BB0_8 Depth 3
	movq	%r14, %rdi
	callq	_pthread_mutex_lock
LBB0_3:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_8 Depth 3
	movl	8(%r12), %eax
	testl	%eax, %eax
	jle	LBB0_4
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=2
	movq	32(%r12), %rdx
	xorl	%ecx, %ecx
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_8 Depth=3
	incq	%rcx
	addq	$32, %rdx
	cmpq	%rcx, %rax
	je	LBB0_12
LBB0_8:                                 ##   Parent Loop BB0_2 Depth=1
                                        ##     Parent Loop BB0_3 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	cmpq	%rbx, %rdx
	je	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=3
	cmpl	$0, 8(%rdx)
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=3
	movq	(%rdx), %rsi
	cmpq	(%rbx), %rsi
	jne	LBB0_11
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=2
	cmpl	%eax, %ecx
	jne	LBB0_6
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_3 Depth=2
	xorl	%ecx, %ecx
	cmpl	%eax, %ecx
	je	LBB0_12
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=2
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_pthread_cond_wait
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	$1, 8(%rbx)
	movq	%r14, %rdi
	callq	_pthread_mutex_unlock
	movq	24(%r12), %rax
	movl	20(%r12), %edi
	movq	(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_13
## %bb.14:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	16(%rbx), %rdx
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
	xorl	%edx, %edx
LBB0_15:                                ##   in Loop: Header=BB0_2 Depth=1
	callq	*%rax
	movq	%rax, 16(%rbx)
	movq	%r14, %rdi
	callq	_pthread_mutex_lock
	movq	(%rbx), %rax
	movq	(%r12), %rcx
	leaq	-1(%rcx), %rdx
	cmpq	%rdx, %rax
	je	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_2 Depth=1
	cmpq	$0, 16(%rbx)
	jne	LBB0_17
	jmp	LBB0_20
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_2 Depth=1
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
	movl	%edx, %ecx
	jmp	LBB0_20
LBB0_21:
	xorl	%edi, %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pthread_exit                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_ktp_worker
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ktp_worker
_ktp_worker:                            ; @ktp_worker
	.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
	ldr	x22, [x0, #24]
	ldr	x8, [x0]
	ldr	x9, [x22]
	cmp	x8, x9
	b.ge	LBB0_19
; %bb.1:
	mov	x19, x0
	add	x20, x22, #12
	add	x21, x22, #16
	mov	w23, #1
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x9, x9, #1
	sdiv	x10, x9, x8
	msub	x8, x10, x8, x9
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	str	x8, [x19]
	str	wzr, [x19, #8]
	mov	x0, x21
	bl	_pthread_cond_broadcast
	mov	x0, x20
	bl	_pthread_mutex_unlock
	ldr	x8, [x19]
	ldr	x9, [x22]
	cmp	x8, x9
	b.ge	LBB0_19
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
                                        ;       Child Loop BB0_8 Depth 3
	mov	x0, x20
	bl	_pthread_mutex_lock
LBB0_5:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_8 Depth 3
	ldr	w8, [x22, #8]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=2
	mov	x9, #0
	ldr	x10, [x22, #32]
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=3
	add	x9, x9, #1
	add	x10, x10, #32
	cmp	x8, x9
	b.eq	LBB0_14
LBB0_8:                                 ;   Parent Loop BB0_4 Depth=1
                                        ;     Parent Loop BB0_5 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	cmp	x10, x19
	b.eq	LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=3
	ldr	w11, [x10, #8]
	cbz	w11, LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=3
	ldr	x11, [x10]
	ldr	x12, [x19]
	cmp	x11, x12
	b.ne	LBB0_7
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=2
	cmp	w9, w8
	b.ne	LBB0_13
	b	LBB0_14
LBB0_12:                                ;   in Loop: Header=BB0_5 Depth=2
	mov	w9, #0
	cmp	w9, w8
	b.eq	LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_5 Depth=2
	mov	x0, x21
	mov	x1, x20
	bl	_pthread_cond_wait
	b	LBB0_5
LBB0_14:                                ;   in Loop: Header=BB0_4 Depth=1
	str	w23, [x19, #8]
	mov	x0, x20
	bl	_pthread_mutex_unlock
	ldr	x8, [x22, #24]
	ldr	w0, [x22, #20]
	ldr	x1, [x19]
	cbz	x1, LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	x2, [x19, #16]
	b	LBB0_17
LBB0_16:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x2, #0
LBB0_17:                                ;   in Loop: Header=BB0_4 Depth=1
	blr	x8
	str	x0, [x19, #16]
	mov	x0, x20
	bl	_pthread_mutex_lock
	ldr	x9, [x19]
	ldr	x8, [x22]
	sub	x10, x8, #1
	cmp	x9, x10
	b.eq	LBB0_2
; %bb.18:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	x10, [x19, #16]
	cbnz	x10, LBB0_2
	b	LBB0_3
LBB0_19:
	mov	w0, #0
	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
	b	_pthread_exit
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_ktp_worker
.subsections_via_symbols
