	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bluray_open
_bluray_open:                           ## @bluray_open
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rax
	movq	%rdi, %r12
	movq	(%rdi), %r15
	movq	%rsi, -56(%rbp)
	movq	_BLURAY_PROTO_PREFIX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	-56(%rbp), %rdx
	movq	%rax, %rdi
	callq	_av_strstart
	movq	-56(%rbp), %rdi
	xorl	%esi, %esi
	callq	_bd_open
	movl	%eax, 20(%r15)
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	%r12, %rdi
	callq	_check_disc_info
	testq	%rax, %rax
	js	LBB0_3
## %bb.4:
	movl	20(%r15), %edi
	movq	_TITLES_RELEVANT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MIN_PLAYLIST_LENGTH@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_bd_get_titles
	movl	%eax, %ebx
	movq	_AV_LOG_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%r12, %rdi
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_av_log
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	testl	%ebx, %ebx
	jle	LBB0_3
## %bb.5:
	movl	(%r15), %esi
	testl	%esi, %esi
	jns	LBB0_11
## %bb.6:
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=1
	movq	%r13, %rdi
	callq	_bd_free_title_info
	incl	%ebx
	cmpl	%ebx, -44(%rbp)                 ## 4-byte Folded Reload
	je	LBB0_10
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	20(%r15), %edi
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	_bd_get_title_info
	movq	%rax, %r13
	movq	_AV_LOG_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r13), %ecx
	movslq	4(%r13), %rdx
	imulq	$1563749871, %rdx, %rax         ## imm = 0x5D34EDEF
	movq	%rax, %rdi
	shrq	$63, %rdi
	sarq	$47, %rax
	addl	%edi, %eax
	imulq	$1779199853, %rdx, %r8          ## imm = 0x6A0C6F6D
	movq	%r8, %rdx
	shrq	$63, %rdx
	sarq	$59, %r8
	addl	%edx, %r8d
	movswl	%ax, %r10d
	imull	$-28253, %r10d, %edi            ## imm = 0x91A3
	shrl	$16, %edi
	addl	%eax, %edi
	movzwl	%di, %edi
	movswl	%di, %edx
	shrl	$15, %edi
	sarl	$11, %edx
	addl	%edi, %edx
	imull	$3600, %edx, %edx               ## imm = 0xE10
	movl	%eax, %edi
	subl	%edx, %edi
	movswl	%di, %edx
	imull	$-30583, %edx, %edx             ## imm = 0x8889
	shrl	$16, %edx
	addl	%edi, %edx
	movzwl	%dx, %edx
	movswl	%dx, %edi
	shrl	$15, %edx
	sarl	$5, %edi
	addl	%edx, %edi
	movswl	%di, %r9d
	imull	$-30583, %r10d, %edx            ## imm = 0x8889
	shrl	$16, %edx
	addl	%eax, %edx
	movzwl	%dx, %edx
	movswl	%dx, %edi
	shrl	$15, %edx
	sarl	$5, %edi
	addl	%edx, %edi
	imull	$60, %edi, %edx
	subl	%edx, %eax
	cwtl
	movl	%eax, (%rsp)
	movq	%r12, %rdi
	leaq	L_.str.2(%rip), %rdx
                                        ## kill: def $r8d killed $r8d killed $r8
	xorl	%eax, %eax
	callq	_av_log
	movl	4(%r13), %eax
	cmpl	%r14d, %eax
	jle	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	(%r13), %ecx
	movl	%ecx, (%r15)
	movl	%eax, %r14d
	jmp	LBB0_9
LBB0_1:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_av_log
	jmp	LBB0_3
LBB0_10:
	movl	(%r15), %ecx
	movq	_AV_LOG_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.3(%rip), %rdx
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_av_log
	movl	(%r15), %esi
LBB0_11:
	movl	20(%r15), %edi
	callq	_bd_select_playlist
	testq	%rax, %rax
	jle	LBB0_12
## %bb.13:
	movq	8(%r15), %rsi
	testq	%rsi, %rsi
	js	LBB0_15
## %bb.14:
	movl	20(%r15), %edi
	callq	_bd_select_angle
LBB0_15:
	movl	16(%r15), %esi
	xorl	%ebx, %ebx
	cmpl	$2, %esi
	jl	LBB0_17
## %bb.16:
	movl	20(%r15), %edi
	decl	%esi
	callq	_bd_seek_chapter
	jmp	LBB0_17
LBB0_12:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r15), %ecx
	leaq	L_.str.4(%rip), %rdx
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_av_log
LBB0_3:
	movq	_EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, %ebx
LBB0_17:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BLURAY_PROTO_PREFIX,4,2        ## @BLURAY_PROTO_PREFIX
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bd_open() failed\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_TITLES_RELEVANT,4,2            ## @TITLES_RELEVANT
	.comm	_MIN_PLAYLIST_LENGTH,4,2        ## @MIN_PLAYLIST_LENGTH
	.comm	_AV_LOG_INFO,4,2                ## @AV_LOG_INFO
L_.str.1:                               ## @.str.1
	.asciz	"%d usable playlists:\n"

L_.str.2:                               ## @.str.2
	.asciz	"playlist %05d.mpls (%d:%02d:%02d)\n"

L_.str.3:                               ## @.str.3
	.asciz	"selected %05d.mpls\n"

L_.str.4:                               ## @.str.4
	.asciz	"bd_select_playlist(%05d.mpls) failed\n"

	.no_dead_strip	_bluray_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bluray_open
_bluray_open:                           ; @bluray_open
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	mov	x8, x1
	mov	x19, x0
	ldr	x24, [x0]
	str	x1, [sp, #40]
Lloh0:
	adrp	x9, _BLURAY_PROTO_PREFIX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _BLURAY_PROTO_PREFIX@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x9]
	add	x2, sp, #40
	mov	x0, x8
	bl	_av_strstart
	ldr	x0, [sp, #40]
	mov	x1, #0
	bl	_bd_open
	str	w0, [x24, #20]
	cbz	w0, LBB0_8
; %bb.1:
	mov	x0, x19
	bl	_check_disc_info
	tbnz	x0, #63, LBB0_18
; %bb.2:
	ldr	w0, [x24, #20]
Lloh3:
	adrp	x8, _TITLES_RELEVANT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TITLES_RELEVANT@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x8, _MIN_PLAYLIST_LENGTH@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MIN_PLAYLIST_LENGTH@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	bl	_bd_get_titles
	mov	x20, x0
Lloh9:
	adrp	x8, _AV_LOG_INFO@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AV_LOG_INFO@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	str	x20, [sp]
Lloh12:
	adrp	x2, l_.str.1@PAGE
Lloh13:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_av_log
	cmp	w20, #0
	b.le	LBB0_18
; %bb.3:
	ldr	w1, [x24]
	tbz	w1, #31, LBB0_10
; %bb.4:
	mov	w21, #0
	mov	w26, #0
	mov	w28, #3600
	mov	w27, #-30583
	mov	w25, #60
Lloh14:
	adrp	x22, l_.str.2@PAGE
Lloh15:
	add	x22, x22, l_.str.2@PAGEOFF
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x23
	bl	_bd_free_title_info
	add	w21, w21, #1
	cmp	w20, w21
	b.eq	LBB0_9
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x24, #20]
	mov	x1, x21
	mov	w2, #0
	bl	_bd_get_title_info
	mov	x23, x0
	ldp	w9, w8, [x0]
                                        ; kill: def $w8 killed $w8 def $x8
	sxtw	x8, w8
	mov	w10, #60911
	movk	w10, #23860, lsl #16
	mul	x10, x8, x10
	lsr	x11, x10, #63
	asr	x10, x10, #47
	add	w10, w10, w11
	mov	w11, #28525
	movk	w11, #27148, lsl #16
	mul	x8, x8, x11
	lsr	x11, x8, #63
	asr	x8, x8, #59
	add	w8, w8, w11
	sxth	w11, w10
	mov	w12, #-28253
	mul	w12, w11, w12
	add	w12, w10, w12, lsr #16
	and	w13, w12, #0x8000
	sbfx	w12, w12, #11, #5
	add	w12, w12, w13, lsr #15
	msub	w12, w12, w28, w10
	sxth	w13, w12
	mul	w13, w13, w27
	add	w12, w12, w13, lsr #16
	and	w13, w12, #0x8000
	sbfx	w12, w12, #5, #11
	add	w12, w12, w13, lsr #15
	mul	w11, w11, w27
	add	w11, w10, w11, lsr #16
	and	w13, w11, #0x8000
	sxth	w11, w11
	lsr	w11, w11, #5
	add	w11, w11, w13, lsr #15
Lloh16:
	adrp	x13, _AV_LOG_INFO@GOTPAGE
Lloh17:
	ldr	x13, [x13, _AV_LOG_INFO@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x13]
	msub	w10, w11, w25, w10
	stp	x9, x8, [sp]
	sxth	x8, w10
	sxtw	x9, w12
	stp	x9, x8, [sp, #16]
	mov	x0, x19
	mov	x2, x22
	bl	_av_log
	ldr	w8, [x23, #4]
	cmp	w8, w26
	b.le	LBB0_5
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w9, [x23]
	str	w9, [x24]
	mov	x26, x8
	b	LBB0_5
LBB0_8:
Lloh19:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh20:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
Lloh22:
	adrp	x2, l_.str@PAGE
Lloh23:
	add	x2, x2, l_.str@PAGEOFF
	b	LBB0_17
LBB0_9:
Lloh24:
	adrp	x8, _AV_LOG_INFO@GOTPAGE
Lloh25:
	ldr	x8, [x8, _AV_LOG_INFO@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	ldr	w8, [x24]
	str	x8, [sp]
Lloh27:
	adrp	x2, l_.str.3@PAGE
Lloh28:
	add	x2, x2, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_av_log
	ldr	w1, [x24]
LBB0_10:
	ldr	w0, [x24, #20]
	bl	_bd_select_playlist
	cmp	x0, #0
	b.le	LBB0_16
; %bb.11:
	ldr	x1, [x24, #8]
	tbnz	x1, #63, LBB0_13
; %bb.12:
	ldr	w0, [x24, #20]
	bl	_bd_select_angle
LBB0_13:
	ldr	w8, [x24, #16]
	cmp	w8, #2
	b.lt	LBB0_15
; %bb.14:
	ldr	w0, [x24, #20]
	sub	w1, w8, #1
	bl	_bd_seek_chapter
LBB0_15:
	mov	w0, #0
	b	LBB0_19
LBB0_16:
Lloh29:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh30:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	ldr	w8, [x24]
	str	x8, [sp]
Lloh32:
	adrp	x2, l_.str.4@PAGE
Lloh33:
	add	x2, x2, l_.str.4@PAGEOFF
LBB0_17:
	mov	x0, x19
	bl	_av_log
LBB0_18:
Lloh34:
	adrp	x8, _EIO@GOTPAGE
Lloh35:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh36:
	ldr	w0, [x8]
	bl	_AVERROR
LBB0_19:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_BLURAY_PROTO_PREFIX,4,2        ; @BLURAY_PROTO_PREFIX
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bd_open() failed\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_TITLES_RELEVANT,4,2            ; @TITLES_RELEVANT
	.comm	_MIN_PLAYLIST_LENGTH,4,2        ; @MIN_PLAYLIST_LENGTH
	.comm	_AV_LOG_INFO,4,2                ; @AV_LOG_INFO
l_.str.1:                               ; @.str.1
	.asciz	"%d usable playlists:\n"

l_.str.2:                               ; @.str.2
	.asciz	"playlist %05d.mpls (%d:%02d:%02d)\n"

l_.str.3:                               ; @.str.3
	.asciz	"selected %05d.mpls\n"

l_.str.4:                               ; @.str.4
	.asciz	"bd_select_playlist(%05d.mpls) failed\n"

	.no_dead_strip	_bluray_open
.subsections_via_symbols
