	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cdrom_count_tracks
_cdrom_count_tracks:                    ## @cdrom_count_tracks
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rsi)
	movq	$0, 16(%rsi)
	movq	_CD_COUNT_TRACKS@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_cdinfo
	movq	(%r15), %rax
	movq	_CDROMREADTOCHDR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	-88(%rbp), %rdx
	movq	%r15, %rdi
	callq	*(%rax)
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	movq	_ENOMEDIUM@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	jne	LBB0_16
## %bb.2:
	movq	_CDS_NO_DISC@GOTPCREL(%rip), %rax
	jmp	LBB0_17
LBB0_3:
	movq	_CDROM_MSF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)
	movl	-84(%rbp), %ebx
	movl	-80(%rbp), %edx
	cmpl	%edx, %ebx
	jle	LBB0_6
LBB0_4:
	movl	(%r13), %edi
	movl	12(%r14), %ecx
	movl	8(%r14), %r8d
	movl	(%r14), %eax
	movl	4(%r14), %r9d
	movl	%eax, (%rsp)
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_cdinfo
	jmp	LBB0_18
LBB0_6:
	leaq	-64(%rbp), %r12
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_9 Depth=1
	incl	12(%r14)
	movl	-64(%rbp), %ecx
LBB0_8:                                 ##   in Loop: Header=BB0_9 Depth=1
	movl	(%r13), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_cdinfo
	leal	1(%rbx), %eax
	movl	-80(%rbp), %edx
	cmpl	%edx, %ebx
	movl	%eax, %ebx
	jge	LBB0_4
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, -52(%rbp)
	movq	(%r15), %rax
	movq	_CDROMREADTOCENTRY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%r15, %rdi
	movq	%r12, %rdx
	callq	*(%rax)
	testl	%eax, %eax
	jne	LBB0_16
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	-48(%rbp), %r8d
	movq	_CDROM_DATA_TRACK@GOTPCREL(%rip), %rax
	testl	%r8d, (%rax)
	je	LBB0_7
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	-64(%rbp), %ecx
	cmpl	$32, %ecx
	je	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_9 Depth=1
	cmpl	$16, %ecx
	jne	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_9 Depth=1
	incl	4(%r14)
	movl	$16, %ecx
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_9 Depth=1
	incl	(%r14)
	movl	$32, %ecx
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_9 Depth=1
	incl	8(%r14)
	jmp	LBB0_8
LBB0_16:
	movq	_CDS_NO_INFO@GOTPCREL(%rip), %rax
LBB0_17:
	movq	(%rax), %rax
	movq	%rax, 16(%r14)
LBB0_18:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CD_COUNT_TRACKS,4,2            ## @CD_COUNT_TRACKS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"entering cdrom_count_tracks\n"

	.comm	_CDROMREADTOCHDR,4,2            ## @CDROMREADTOCHDR
	.comm	_ENOMEDIUM,4,2                  ## @ENOMEDIUM
	.comm	_CDS_NO_DISC,8,3                ## @CDS_NO_DISC
	.comm	_CDS_NO_INFO,8,3                ## @CDS_NO_INFO
	.comm	_CDROM_MSF,4,2                  ## @CDROM_MSF
	.comm	_CDROMREADTOCENTRY,4,2          ## @CDROMREADTOCENTRY
	.comm	_CDROM_DATA_TRACK,4,2           ## @CDROM_DATA_TRACK
L_.str.1:                               ## @.str.1
	.asciz	"track %d: format=%d, ctrl=%d\n"

L_.str.2:                               ## @.str.2
	.asciz	"disc has %d tracks: %d=audio %d=data %d=Cd-I %d=XA\n"

	.no_dead_strip	_cdrom_count_tracks
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cdrom_count_tracks
_cdrom_count_tracks:                    ; @cdrom_count_tracks
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	x26, x25, [sp, #96]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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, x1
	mov	x20, x0
	stp	xzr, xzr, [x1]
	str	xzr, [x1, #16]
Lloh0:
	adrp	x22, _CD_COUNT_TRACKS@GOTPAGE
Lloh1:
	ldr	x22, [x22, _CD_COUNT_TRACKS@GOTPAGEOFF]
	ldr	w0, [x22]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_cdinfo
	ldr	x8, [x20]
	ldr	x8, [x8]
Lloh4:
	adrp	x9, _CDROMREADTOCHDR@GOTPAGE
Lloh5:
	ldr	x9, [x9, _CDROMREADTOCHDR@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x9]
	add	x2, sp, #72
	mov	x0, x20
	blr	x8
	cbz	w0, LBB0_3
; %bb.1:
Lloh7:
	adrp	x8, _ENOMEDIUM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOMEDIUM@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	adrp	x9, _CDS_NO_DISC@GOTPAGE
Lloh11:
	ldr	x9, [x9, _CDS_NO_DISC@GOTPAGEOFF]
Lloh12:
	adrp	x10, _CDS_NO_INFO@GOTPAGE
Lloh13:
	ldr	x10, [x10, _CDS_NO_INFO@GOTPAGEOFF]
	cmn	w0, w8
	csel	x8, x9, x10, eq
LBB0_2:
	ldr	x8, [x8]
	str	x8, [x19, #16]
	b	LBB0_5
LBB0_3:
Lloh14:
	adrp	x8, _CDROM_MSF@GOTPAGE
Lloh15:
	ldr	x8, [x8, _CDROM_MSF@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	str	w8, [sp, #48]
	ldp	w23, w8, [sp, #76]
	cmp	w23, w8
	b.le	LBB0_6
LBB0_4:
	ldr	w0, [x22]
	ldp	w10, w9, [x19, #8]
	ldp	w12, w11, [x19]
	stp	x11, x12, [sp, #24]
	stp	x9, x10, [sp, #8]
	str	x8, [sp]
Lloh17:
	adrp	x1, l_.str.2@PAGE
Lloh18:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_cdinfo
LBB0_5:
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #96]             ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
LBB0_6:
Lloh19:
	adrp	x24, _CDROMREADTOCENTRY@GOTPAGE
Lloh20:
	ldr	x24, [x24, _CDROMREADTOCENTRY@GOTPAGEOFF]
Lloh21:
	adrp	x25, _CDROM_DATA_TRACK@GOTPAGE
Lloh22:
	ldr	x25, [x25, _CDROM_DATA_TRACK@GOTPAGEOFF]
Lloh23:
	adrp	x21, l_.str.1@PAGE
Lloh24:
	add	x21, x21, l_.str.1@PAGEOFF
	b	LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=1
	ldr	w9, [x19, #12]
	add	w9, w9, #1
	str	w9, [x19, #12]
	ldr	w9, [sp, #48]
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	ldr	w0, [x22]
	stp	x9, x8, [sp, #8]
	str	x23, [sp]
	mov	x1, x21
	bl	_cdinfo
	add	w9, w23, #1
	ldr	w8, [sp, #80]
	cmp	w23, w8
	mov	x23, x9
	b.ge	LBB0_4
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	str	w23, [sp, #60]
	ldr	x8, [x20]
	ldr	x8, [x8]
	ldr	w1, [x24]
	add	x2, sp, #48
	mov	x0, x20
	blr	x8
	cbnz	w0, LBB0_16
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w8, [sp, #64]
	ldr	w9, [x25]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w9, [sp, #48]
	cmp	w9, #32
	b.eq	LBB0_14
; %bb.12:                               ;   in Loop: Header=BB0_9 Depth=1
	cmp	w9, #16
	b.ne	LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w9, [x19, #4]
	add	w9, w9, #1
	str	w9, [x19, #4]
	mov	w9, #16
	b	LBB0_8
LBB0_14:                                ;   in Loop: Header=BB0_9 Depth=1
	ldr	w9, [x19]
	add	w9, w9, #1
	str	w9, [x19]
	mov	w9, #32
	b	LBB0_8
LBB0_15:                                ;   in Loop: Header=BB0_9 Depth=1
	ldr	w10, [x19, #8]
	add	w10, w10, #1
	str	w10, [x19, #8]
	b	LBB0_8
LBB0_16:
Lloh25:
	adrp	x8, _CDS_NO_INFO@GOTPAGE
Lloh26:
	ldr	x8, [x8, _CDS_NO_INFO@GOTPAGEOFF]
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_CD_COUNT_TRACKS,4,2            ; @CD_COUNT_TRACKS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"entering cdrom_count_tracks\n"

	.comm	_CDROMREADTOCHDR,4,2            ; @CDROMREADTOCHDR
	.comm	_ENOMEDIUM,4,2                  ; @ENOMEDIUM
	.comm	_CDS_NO_DISC,8,3                ; @CDS_NO_DISC
	.comm	_CDS_NO_INFO,8,3                ; @CDS_NO_INFO
	.comm	_CDROM_MSF,4,2                  ; @CDROM_MSF
	.comm	_CDROMREADTOCENTRY,4,2          ; @CDROMREADTOCENTRY
	.comm	_CDROM_DATA_TRACK,4,2           ; @CDROM_DATA_TRACK
l_.str.1:                               ; @.str.1
	.asciz	"track %d: format=%d, ctrl=%d\n"

l_.str.2:                               ; @.str.2
	.asciz	"disc has %d tracks: %d=audio %d=data %d=Cd-I %d=XA\n"

	.no_dead_strip	_cdrom_count_tracks
.subsections_via_symbols
