	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function thread_func
_thread_func:                           ## @thread_func
	.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, %rbx
	xorl	%eax, %eax
	callq	_getpid
	movl	%eax, 92(%rbx)
	xorl	%eax, %eax
	callq	_hb_get_temporary_directory
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_hb_mkdir
	movq	%r14, %rdi
	callq	_free
	cmpl	$0, 88(%rbx)
	je	LBB0_1
LBB0_17:
	cmpq	$0, 8(%rbx)
	je	LBB0_19
## %bb.18:
	leaq	8(%rbx), %r14
	movq	%rbx, %rdi
	callq	_hb_scan_stop
	movq	%r14, %rdi
	callq	_hb_thread_close
LBB0_19:
	cmpq	$0, (%rbx)
	je	LBB0_21
## %bb.20:
	movq	%rbx, %rdi
	callq	_hb_stop
	movq	%rbx, %rdi
	callq	_hb_thread_close
LBB0_21:
	movq	%rbx, %rdi
	callq	_hb_remove_previews
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	leaq	8(%rbx), %r14
	movq	_HB_STATE_SCANDONE@GOTPCREL(%rip), %r13
	leaq	-48(%rbp), %r12
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	$50, %edi
	callq	_hb_snooze
	cmpl	$0, 88(%rbx)
	jne	LBB0_17
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
	movq	(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_11
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	callq	_hb_thread_has_exited
	testq	%rax, %rax
	je	LBB0_11
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %rdi
	callq	_hb_thread_close
	cmpq	$0, 80(%rbx)
	je	LBB0_9
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	callq	_hb_remove_previews
	.p2align	4, 0x90
LBB0_7:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	72(%rbx), %edi
	xorl	%esi, %esi
	callq	_hb_list_item
	movq	%rax, -48(%rbp)
	testq	%rax, %rax
	je	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_7 Depth=2
	movl	72(%rbx), %edi
	movq	%rax, %rsi
	callq	_hb_list_rem
	movq	%r12, %rdi
	callq	_hb_title_close
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_hb_log
	jmp	LBB0_10
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	72(%rbx), %edi
	callq	_hb_list_count
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_hb_log
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	64(%rbx), %edi
	callq	_hb_lock
	movl	(%r13), %eax
	movl	%eax, 48(%rbx)
	movl	64(%rbx), %edi
	callq	_hb_unlock
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_2 Depth=1
	callq	_hb_thread_has_exited
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	callq	_hb_thread_close
	movl	68(%rbx), %esi
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_hb_log
	movl	64(%rbx), %edi
	callq	_hb_lock
	movq	_HB_STATE_WORKDONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 48(%rbx)
	movl	64(%rbx), %edi
	movl	68(%rbx), %eax
	movl	%eax, 40(%rbx)
	callq	_hb_unlock
LBB0_14:                                ##   in Loop: Header=BB0_2 Depth=1
	cmpq	$0, 56(%rbx)
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	24(%rbx), %r15
	xorl	%eax, %eax
	callq	_hb_get_date
	addq	%r15, %rax
	subq	16(%rbx), %rax
	movq	%rax, 32(%rbx)
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"hb_scan: canceled"

L_.str.1:                               ## @.str.1
	.asciz	"libhb: scan thread found %d valid title(s)"

	.comm	_HB_STATE_SCANDONE,4,2          ## @HB_STATE_SCANDONE
L_.str.2:                               ## @.str.2
	.asciz	"libhb: work result = %d"

	.comm	_HB_STATE_WORKDONE,4,2          ## @HB_STATE_WORKDONE
	.no_dead_strip	_thread_func
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function thread_func
_thread_func:                           ; @thread_func
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	bl	_getpid
	str	w0, [x19, #92]
	bl	_hb_get_temporary_directory
	mov	x20, x0
	bl	_hb_mkdir
	mov	x0, x20
	bl	_free
	ldr	w8, [x19, #88]
	cbz	w8, LBB0_6
LBB0_1:
	mov	x20, x19
	ldr	x8, [x20, #8]!
	cbz	x8, LBB0_3
; %bb.2:
	mov	x0, x19
	bl	_hb_scan_stop
	mov	x0, x20
	bl	_hb_thread_close
LBB0_3:
	ldr	x8, [x19]
	cbz	x8, LBB0_5
; %bb.4:
	mov	x0, x19
	bl	_hb_stop
	mov	x0, x19
	bl	_hb_thread_close
LBB0_5:
	mov	x0, x19
	bl	_hb_remove_previews
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_6:
	add	x20, x19, #8
Lloh0:
	adrp	x21, l_.str.2@PAGE
Lloh1:
	add	x21, x21, l_.str.2@PAGEOFF
Lloh2:
	adrp	x24, _HB_STATE_WORKDONE@GOTPAGE
Lloh3:
	ldr	x24, [x24, _HB_STATE_WORKDONE@GOTPAGEOFF]
Lloh4:
	adrp	x22, l_.str.1@PAGE
Lloh5:
	add	x22, x22, l_.str.1@PAGEOFF
Lloh6:
	adrp	x25, _HB_STATE_SCANDONE@GOTPAGE
Lloh7:
	ldr	x25, [x25, _HB_STATE_SCANDONE@GOTPAGEOFF]
Lloh8:
	adrp	x23, l_.str@PAGE
Lloh9:
	add	x23, x23, l_.str@PAGEOFF
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	mov	w0, #50
	bl	_hb_snooze
	ldr	w8, [x19, #88]
	cbnz	w8, LBB0_1
LBB0_8:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_13 Depth 2
	ldr	x0, [x20]
	cbz	x0, LBB0_17
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	bl	_hb_thread_has_exited
	cbz	x0, LBB0_17
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x20
	bl	_hb_thread_close
	ldr	x8, [x19, #80]
	cbz	x8, LBB0_15
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x19
	bl	_hb_remove_previews
	ldr	w0, [x19, #72]
	mov	w1, #0
	bl	_hb_list_item
	str	x0, [sp, #8]
	cbz	x0, LBB0_14
; %bb.12:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x1, x0
LBB0_13:                                ;   Parent Loop BB0_8 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w0, [x19, #72]
	bl	_hb_list_rem
	add	x0, sp, #8
	bl	_hb_title_close
	ldr	w0, [x19, #72]
	mov	w1, #0
	bl	_hb_list_item
	mov	x1, x0
	str	x0, [sp, #8]
	cbnz	x0, LBB0_13
LBB0_14:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x23
	b	LBB0_16
LBB0_15:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	w0, [x19, #72]
	bl	_hb_list_count
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
	mov	x0, x22
LBB0_16:                                ;   in Loop: Header=BB0_8 Depth=1
	bl	_hb_log
	ldr	w0, [x19, #64]
	bl	_hb_lock
	ldr	w8, [x25]
	str	w8, [x19, #48]
	ldr	w0, [x19, #64]
	bl	_hb_unlock
LBB0_17:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	x0, [x19]
	cbz	x0, LBB0_20
; %bb.18:                               ;   in Loop: Header=BB0_8 Depth=1
	bl	_hb_thread_has_exited
	cbz	x0, LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x19
	bl	_hb_thread_close
	ldr	w8, [x19, #68]
	str	x8, [sp]
	mov	x0, x21
	bl	_hb_log
	ldr	w0, [x19, #64]
	bl	_hb_lock
	ldr	w8, [x24]
	str	w8, [x19, #48]
	ldp	w0, w8, [x19, #64]
	str	w8, [x19, #40]
	bl	_hb_unlock
LBB0_20:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	x8, [x19, #56]
	cbz	x8, LBB0_7
; %bb.21:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	x26, [x19, #24]
	bl	_hb_get_date
	ldr	x8, [x19, #16]
	add	x9, x0, x26
	sub	x8, x9, x8
	str	x8, [x19, #32]
	b	LBB0_7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"hb_scan: canceled"

l_.str.1:                               ; @.str.1
	.asciz	"libhb: scan thread found %d valid title(s)"

	.comm	_HB_STATE_SCANDONE,4,2          ; @HB_STATE_SCANDONE
l_.str.2:                               ; @.str.2
	.asciz	"libhb: work result = %d"

	.comm	_HB_STATE_WORKDONE,4,2          ; @HB_STATE_WORKDONE
	.no_dead_strip	_thread_func
.subsections_via_symbols
