	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hb_get_preview2                ## -- Begin function hb_get_preview2
	.p2align	4, 0x90
_hb_get_preview2:                       ## @hb_get_preview2
	.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
	subq	$1192, %rsp                     ## imm = 0x4A8
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, -1204(%rbp)               ## 4-byte Spill
	movq	%rcx, %r12
	movl	%edx, -1208(%rbp)               ## 4-byte Spill
	movl	%esi, -1184(%rbp)               ## 4-byte Spill
	movq	%rdi, -1232(%rbp)               ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	$0, -1200(%rbp)
	movq	$0, -1192(%rbp)
	movl	12(%rcx), %r13d
	movl	16(%rcx), %eax
	imull	8(%rcx), %eax
	cltd
	idivl	20(%rcx)
	movl	%eax, %r14d
	movq	_HB_MIN_WIDTH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	callq	_MAX
	movq	_HB_MAX_WIDTH@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movl	%eax, %edi
	callq	_MIN
	movl	%eax, %ebx
	imull	%r13d, %eax
	cltd
	idivl	%r14d
	movq	_HB_MIN_HEIGHT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_MAX
	movq	_HB_MAX_HEIGHT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_MIN
	movl	%eax, %r14d
	imull	%eax, %ebx
	movl	%ebx, %eax
	cltd
	idivl	%r13d
	movq	_HB_MIN_WIDTH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_MAX
	movl	(%r15), %esi
	movl	%eax, %edi
	callq	_MIN
	movl	%eax, %esi
	movq	_SWS_LANCZOS@GOTPCREL(%rip), %rax
	movq	_SWS_ACCURATE_RND@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	%rcx, -1224(%rbp)               ## 8-byte Spill
	movq	_AV_PIX_FMT_RGB32@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%esi, -1172(%rbp)               ## 4-byte Spill
	movl	%r14d, -1176(%rbp)              ## 4-byte Spill
	movl	%r14d, %edx
	callq	_hb_frame_buffer_init
	movq	%rax, %rbx
	movq	%rax, -1216(%rbp)
	leaq	-1104(%rbp), %rdi
	leaq	-1152(%rbp), %rsi
	movq	%rax, %rdx
	callq	_hb_picture_fill
	leaq	-1072(%rbp), %rdi
	xorl	%esi, %esi
	movl	$1024, %edx                     ## imm = 0x400
	callq	_memset
	movq	-1232(%rbp), %rdi               ## 8-byte Reload
	movq	%rdi, %r15
	movl	-1184(%rbp), %esi               ## 4-byte Reload
	movl	%esi, %r14d
	callq	_hb_find_title_by_index
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %r13
	movq	%rbx, -1184(%rbp)               ## 8-byte Spill
	movq	%r15, %rdi
	movq	%rax, %rsi
	movl	-1208(%rbp), %edx               ## 4-byte Reload
	callq	_hb_read_preview
	movq	%rax, -1200(%rbp)
	testq	%rax, %rax
	je	LBB0_2
## %bb.4:
	movq	%rax, %rbx
	cmpl	$0, -1204(%rbp)                 ## 4-byte Folded Reload
	je	LBB0_6
## %bb.5:
	movq	_AV_PIX_FMT_YUV420P@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r13), %esi
	movl	4(%r13), %edx
	callq	_hb_frame_buffer_init
	movq	%rax, %r15
	movq	%rax, -1192(%rbp)
	movq	%rax, %rdi
	movq	%rbx, %rsi
	callq	_hb_deinterlace
	movq	(%r12), %rax
	movq	(%rax), %rcx
	movq	16(%rax), %r8
	leaq	-1136(%rbp), %rdi
	leaq	-1168(%rbp), %rsi
	movq	%r15, %rdx
	jmp	LBB0_7
LBB0_1:
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %esi
	callq	_hb_error
	jmp	LBB0_2
LBB0_6:
	movq	(%r12), %rax
	movq	(%rax), %rcx
	movq	16(%rax), %r8
	leaq	-1136(%rbp), %rdi
	leaq	-1168(%rbp), %rsi
	movq	%rbx, %rdx
LBB0_7:
	callq	_hb_picture_crop
	movl	8(%r13), %edi
	callq	_hb_sws_get_colorspace
                                        ## kill: def $eax killed $eax def $rax
	movslq	(%r13), %rdi
	movq	(%r12), %rcx
	movq	(%rcx), %rdx
	movq	16(%rcx), %rsi
	addq	24(%rcx), %rsi
	subq	%rsi, %rdi
	movslq	4(%r13), %rsi
	addq	8(%rcx), %rdx
	subq	%rdx, %rsi
	movq	_AV_PIX_FMT_YUV420P@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_AV_PIX_FMT_RGB32@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r9d
	movl	-1172(%rbp), %ecx               ## 4-byte Reload
	movl	-1176(%rbp), %r8d               ## 4-byte Reload
	pushq	%rax
	pushq	-1224(%rbp)                     ## 8-byte Folded Reload
	callq	_hb_sws_get_context
	addq	$16, %rsp
	testq	%rax, %rax
	je	LBB0_2
## %bb.8:
	movq	%rax, %rbx
	movslq	4(%r13), %r8
	movq	(%r12), %rax
	movq	(%rax), %rcx
	addq	8(%rax), %rcx
	subq	%rcx, %r8
	subq	$8, %rsp
	leaq	-1136(%rbp), %rsi
	leaq	-1168(%rbp), %rdx
	leaq	-1104(%rbp), %r9
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	leaq	-1152(%rbp), %rax
	pushq	%rax
	callq	_sws_scale
	addq	$16, %rsp
	movq	%rbx, %rdi
	callq	_sws_freeContext
	movq	-1184(%rbp), %rdi               ## 8-byte Reload
	callq	_hb_buffer_to_image
	movq	%rax, %rbx
	leaq	-1200(%rbp), %rdi
	callq	_hb_buffer_close
	leaq	-1192(%rbp), %rdi
	callq	_hb_buffer_close
	leaq	-1216(%rbp), %rdi
	callq	_hb_buffer_close
	jmp	LBB0_9
LBB0_2:
	leaq	-1200(%rbp), %rdi
	callq	_hb_buffer_close
	leaq	-1192(%rbp), %rdi
	callq	_hb_buffer_close
	leaq	-1216(%rbp), %rdi
	callq	_hb_buffer_close
	movq	_AV_PIX_FMT_RGB32@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	-1172(%rbp), %esi               ## 4-byte Reload
	movl	-1176(%rbp), %edx               ## 4-byte Reload
	callq	_hb_image_init
	movq	%rax, %rbx
LBB0_9:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_11
## %bb.10:
	movq	%rbx, %rax
	addq	$1192, %rsp                     ## imm = 0x4A8
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_HB_MIN_WIDTH,4,2               ## @HB_MIN_WIDTH
	.comm	_HB_MAX_WIDTH,4,2               ## @HB_MAX_WIDTH
	.comm	_HB_MIN_HEIGHT,4,2              ## @HB_MIN_HEIGHT
	.comm	_HB_MAX_HEIGHT,4,2              ## @HB_MAX_HEIGHT
	.comm	_SWS_LANCZOS,4,2                ## @SWS_LANCZOS
	.comm	_SWS_ACCURATE_RND,4,2           ## @SWS_ACCURATE_RND
	.comm	_AV_PIX_FMT_RGB32,4,2           ## @AV_PIX_FMT_RGB32
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"hb_get_preview2: invalid title (%d)"

	.comm	_AV_PIX_FMT_YUV420P,4,2         ## @AV_PIX_FMT_YUV420P
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hb_get_preview2                ; -- Begin function hb_get_preview2
	.p2align	2
_hb_get_preview2:                       ; @hb_get_preview2
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #1168
	str	w4, [sp, #4]                    ; 4-byte Folded Spill
	mov	x19, x3
	mov	x24, x2
	mov	x25, x1
	mov	x26, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-96]
	stp	xzr, xzr, [sp, #16]
	ldp	w8, w9, [x3, #16]
	ldp	w10, w22, [x3, #8]
	mul	w8, w8, w10
	sdiv	w20, w8, w9
Lloh3:
	adrp	x23, _HB_MIN_WIDTH@GOTPAGE
Lloh4:
	ldr	x23, [x23, _HB_MIN_WIDTH@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x20
	bl	_MAX
Lloh5:
	adrp	x27, _HB_MAX_WIDTH@GOTPAGE
Lloh6:
	ldr	x27, [x27, _HB_MAX_WIDTH@GOTPAGEOFF]
	ldr	w1, [x27]
	bl	_MIN
	mov	x21, x0
	mul	w8, w0, w22
Lloh7:
	adrp	x9, _HB_MIN_HEIGHT@GOTPAGE
Lloh8:
	ldr	x9, [x9, _HB_MIN_HEIGHT@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x9]
	sdiv	w0, w8, w20
	bl	_MAX
Lloh10:
	adrp	x8, _HB_MAX_HEIGHT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _HB_MAX_HEIGHT@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	bl	_MIN
	mov	x20, x0
	mul	w8, w0, w21
	ldr	w1, [x23]
	sdiv	w0, w8, w22
	bl	_MAX
	ldr	w1, [x27]
	bl	_MIN
	mov	x21, x0
Lloh13:
	adrp	x8, _SWS_LANCZOS@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SWS_LANCZOS@GOTPAGEOFF]
Lloh15:
	ldr	w28, [x8]
Lloh16:
	adrp	x8, _SWS_ACCURATE_RND@GOTPAGE
Lloh17:
	ldr	x8, [x8, _SWS_ACCURATE_RND@GOTPAGEOFF]
Lloh18:
	ldr	w23, [x8]
Lloh19:
	adrp	x8, _AV_PIX_FMT_RGB32@GOTPAGE
Lloh20:
	ldr	x8, [x8, _AV_PIX_FMT_RGB32@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	mov	x1, x21
	mov	x2, x20
	bl	_hb_frame_buffer_init
	mov	x22, x0
	str	x0, [sp, #8]
	add	x0, sp, #96
	add	x1, sp, #48
	mov	x2, x22
	bl	_hb_picture_fill
	add	x0, sp, #128
	mov	w1, #0
	mov	w2, #1024
	bl	_memset
	mov	x0, x26
	mov	x1, x25
	bl	_hb_find_title_by_index
	cbz	x0, LBB0_4
; %bb.1:
	mov	x27, x0
	mov	x0, x26
	mov	x1, x27
	mov	x2, x24
	bl	_hb_read_preview
	str	x0, [sp, #24]
	cbz	x0, LBB0_8
; %bb.2:
	mov	x25, x0
	orr	w24, w23, w28
Lloh22:
	adrp	x26, _AV_PIX_FMT_YUV420P@GOTPAGE
Lloh23:
	ldr	x26, [x26, _AV_PIX_FMT_YUV420P@GOTPAGEOFF]
	ldr	w8, [sp, #4]                    ; 4-byte Folded Reload
	cbz	w8, LBB0_5
; %bb.3:
	ldr	w0, [x26]
	ldp	w1, w2, [x27]
	bl	_hb_frame_buffer_init
	mov	x23, x0
	str	x0, [sp, #16]
	mov	x1, x25
	bl	_hb_deinterlace
	ldr	x8, [x19]
	ldr	x3, [x8]
	ldr	x4, [x8, #16]
	add	x0, sp, #64
	add	x1, sp, #32
	mov	x2, x23
	b	LBB0_6
LBB0_4:
Lloh24:
	adrp	x0, l_.str@PAGE
Lloh25:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x25
	bl	_hb_error
	b	LBB0_8
LBB0_5:
	ldr	x8, [x19]
	ldr	x3, [x8]
	ldr	x4, [x8, #16]
	add	x0, sp, #64
	add	x1, sp, #32
	mov	x2, x25
LBB0_6:
	bl	_hb_picture_crop
	ldr	w0, [x27, #8]
	bl	_hb_sws_get_colorspace
	mov	x7, x0
	ldr	x8, [x19]
	ldp	x9, x10, [x8, #16]
	ldpsw	x11, x12, [x27]
	add	x9, x9, x10
	sub	x0, x11, x9
	ldp	x9, x8, [x8]
	add	x8, x9, x8
	sub	x1, x12, x8
	ldr	w2, [x26]
Lloh26:
	adrp	x8, _AV_PIX_FMT_RGB32@GOTPAGE
Lloh27:
	ldr	x8, [x8, _AV_PIX_FMT_RGB32@GOTPAGEOFF]
Lloh28:
	ldr	w5, [x8]
	mov	x3, x21
	mov	x4, x20
	mov	x6, x24
	bl	_hb_sws_get_context
	cbz	x0, LBB0_8
; %bb.7:
	mov	x23, x0
	ldrsw	x8, [x27, #4]
	ldr	x9, [x19]
	ldp	x10, x9, [x9]
	add	x9, x10, x9
	sub	x4, x8, x9
	add	x1, sp, #64
	add	x2, sp, #32
	add	x5, sp, #96
	add	x6, sp, #48
	mov	w3, #0
	bl	_sws_scale
	mov	x0, x23
	bl	_sws_freeContext
	mov	x0, x22
	bl	_hb_buffer_to_image
	mov	x19, x0
	add	x0, sp, #24
	bl	_hb_buffer_close
	add	x0, sp, #16
	bl	_hb_buffer_close
	add	x0, sp, #8
	bl	_hb_buffer_close
	b	LBB0_9
LBB0_8:
	add	x0, sp, #24
	bl	_hb_buffer_close
	add	x0, sp, #16
	bl	_hb_buffer_close
	add	x0, sp, #8
	bl	_hb_buffer_close
Lloh29:
	adrp	x8, _AV_PIX_FMT_RGB32@GOTPAGE
Lloh30:
	ldr	x8, [x8, _AV_PIX_FMT_RGB32@GOTPAGEOFF]
Lloh31:
	ldr	w0, [x8]
	mov	x1, x21
	mov	x2, x20
	bl	_hb_image_init
	mov	x19, x0
LBB0_9:
	ldur	x8, [x29, #-96]
Lloh32:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh33:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh34:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.10:
	mov	x0, x19
	add	sp, sp, #1168
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_11:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_HB_MIN_WIDTH,4,2               ; @HB_MIN_WIDTH
	.comm	_HB_MAX_WIDTH,4,2               ; @HB_MAX_WIDTH
	.comm	_HB_MIN_HEIGHT,4,2              ; @HB_MIN_HEIGHT
	.comm	_HB_MAX_HEIGHT,4,2              ; @HB_MAX_HEIGHT
	.comm	_SWS_LANCZOS,4,2                ; @SWS_LANCZOS
	.comm	_SWS_ACCURATE_RND,4,2           ; @SWS_ACCURATE_RND
	.comm	_AV_PIX_FMT_RGB32,4,2           ; @AV_PIX_FMT_RGB32
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"hb_get_preview2: invalid title (%d)"

	.comm	_AV_PIX_FMT_YUV420P,4,2         ; @AV_PIX_FMT_YUV420P
.subsections_via_symbols
