	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function open_cd
_open_cd:                               ## @open_cd
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	_MAXPATHLEN@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	movq	_fd@GOTPCREL(%rip), %r12
	movl	$1, %r15d
	cmpl	$0, (%r12)
	jns	LBB0_13
## %bb.1:
	movq	_cdname@GOTPCREL(%rip), %rax
	movq	(%rax), %r8
	testq	%r8, %r8
	je	LBB0_6
## %bb.2:
	cmpb	$47, (%r8)
	jne	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	movl	%ebx, %esi
	movq	%r8, %rcx
	xorl	%eax, %eax
	callq	_snprintf
	jmp	LBB0_5
LBB0_6:
	movq	_O_RDONLY@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	L_.str.2(%rip), %r14
	movq	%r14, %rdi
	callq	_open
	movl	%eax, (%r12)
	testl	%eax, %eax
	jns	LBB0_13
## %bb.7:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_ENOENT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.8:
	movl	(%rbx), %esi
	leaq	L_.str.3(%rip), %r14
	jmp	LBB0_9
LBB0_4:
	movq	__PATH_DEV@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	leaq	L_.str.1(%rip), %rdx
	movq	%r14, %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_snprintf
LBB0_5:
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
LBB0_9:
	movq	%r14, %rdi
	callq	_open
	movl	%eax, (%r12)
	testl	%eax, %eax
	jns	LBB0_13
LBB0_10:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_ENXIO@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
## %bb.11:
	leaq	L_.str.4(%rip), %rdi
	movq	%r14, %rsi
	callq	_warnx
	xorl	%r15d, %r15d
	jmp	LBB0_13
LBB0_12:
	leaq	L_.str(%rip), %rsi
	movl	$1, %r15d
	movl	$1, %edi
	movq	%r14, %rdx
	callq	_err
LBB0_13:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_15
## %bb.14:
	movl	%r15d, %eax
	leaq	-32(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MAXPATHLEN,4,2                 ## @MAXPATHLEN
	.comm	_fd,4,2                         ## @fd
	.comm	_cdname,8,3                     ## @cdname
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s"

L_.str.1:                               ## @.str.1
	.asciz	"%s%s"

	.comm	__PATH_DEV,8,3                  ## @_PATH_DEV
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
L_.str.2:                               ## @.str.2
	.asciz	"/dev/cdrom"

	.comm	_errno,8,3                      ## @errno
	.comm	_ENOENT,8,3                     ## @ENOENT
L_.str.3:                               ## @.str.3
	.asciz	"/dev/cd0"

	.comm	_ENXIO,8,3                      ## @ENXIO
L_.str.4:                               ## @.str.4
	.asciz	"no disc in drive %s"

	.no_dead_strip	_open_cd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function open_cd
_open_cd:                               ; @open_cd
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	sub	sp, sp, #16
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-24]
Lloh3:
	adrp	x8, _MAXPATHLEN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAXPATHLEN@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x9, x1
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x1, #15
	and	x9, x9, #0x1fffffff0
	sub	x19, x8, x9
	mov	sp, x19
Lloh8:
	adrp	x20, _fd@GOTPAGE
Lloh9:
	ldr	x20, [x20, _fd@GOTPAGEOFF]
	ldr	w8, [x20]
	tbz	w8, #31, LBB0_10
; %bb.1:
Lloh10:
	adrp	x8, _cdname@GOTPAGE
Lloh11:
	ldr	x8, [x8, _cdname@GOTPAGEOFF]
Lloh12:
	ldr	x3, [x8]
	cbz	x3, LBB0_4
; %bb.2:
	ldrb	w8, [x3]
	cmp	w8, #47
	b.ne	LBB0_7
; %bb.3:
Lloh13:
	adrp	x2, l_.str@PAGE
Lloh14:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_snprintf
	b	LBB0_8
LBB0_4:
Lloh15:
	adrp	x19, _O_RDONLY@GOTPAGE
Lloh16:
	ldr	x19, [x19, _O_RDONLY@GOTPAGEOFF]
	ldr	w1, [x19]
Lloh17:
	adrp	x0, l_.str.2@PAGE
Lloh18:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_open
	str	w0, [x20]
	tbz	w0, #31, LBB0_10
; %bb.5:
Lloh19:
	adrp	x8, _errno@GOTPAGE
Lloh20:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh21:
	ldr	x8, [x8]
Lloh22:
	adrp	x9, _ENOENT@GOTPAGE
Lloh23:
	ldr	x9, [x9, _ENOENT@GOTPAGEOFF]
Lloh24:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_13
; %bb.6:
	ldr	w1, [x19]
Lloh25:
	adrp	x19, l_.str.3@PAGE
Lloh26:
	add	x19, x19, l_.str.3@PAGEOFF
	b	LBB0_9
LBB0_7:
Lloh27:
	adrp	x8, __PATH_DEV@GOTPAGE
Lloh28:
	ldr	x8, [x8, __PATH_DEV@GOTPAGEOFF]
Lloh29:
	ldr	x8, [x8]
	str	x3, [sp, #-16]!
Lloh30:
	adrp	x2, l_.str.1@PAGE
Lloh31:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
                                        ; kill: def $w1 killed $w1 killed $x1
	mov	x3, x8
	bl	_snprintf
	add	sp, sp, #16
LBB0_8:
Lloh32:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh33:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
LBB0_9:
	mov	x0, x19
	bl	_open
	str	w0, [x20]
	tbnz	w0, #31, LBB0_14
LBB0_10:
	mov	w20, #1
LBB0_11:
	ldur	x8, [x29, #-24]
Lloh35:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh36:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh37:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_17
; %bb.12:
	mov	x0, x20
	sub	sp, x29, #16
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_13:
Lloh38:
	adrp	x19, l_.str.2@PAGE
Lloh39:
	add	x19, x19, l_.str.2@PAGEOFF
LBB0_14:
Lloh40:
	adrp	x8, _errno@GOTPAGE
Lloh41:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh42:
	ldr	x8, [x8]
Lloh43:
	adrp	x9, _ENXIO@GOTPAGE
Lloh44:
	ldr	x9, [x9, _ENXIO@GOTPAGEOFF]
Lloh45:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_16
; %bb.15:
Lloh46:
	adrp	x0, l_.str.4@PAGE
Lloh47:
	add	x0, x0, l_.str.4@PAGEOFF
	mov	x1, x19
	bl	_warnx
	mov	w20, #0
	b	LBB0_11
LBB0_16:
Lloh48:
	adrp	x1, l_.str@PAGE
Lloh49:
	add	x1, x1, l_.str@PAGEOFF
	mov	w20, #1
	mov	w0, #1
	mov	x2, x19
	bl	_err
	b	LBB0_11
LBB0_17:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpAdd	Lloh48, Lloh49
	.cfi_endproc
                                        ; -- End function
	.comm	_MAXPATHLEN,4,2                 ; @MAXPATHLEN
	.comm	_fd,4,2                         ; @fd
	.comm	_cdname,8,3                     ; @cdname
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s"

l_.str.1:                               ; @.str.1
	.asciz	"%s%s"

	.comm	__PATH_DEV,8,3                  ; @_PATH_DEV
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
l_.str.2:                               ; @.str.2
	.asciz	"/dev/cdrom"

	.comm	_errno,8,3                      ; @errno
	.comm	_ENOENT,8,3                     ; @ENOENT
l_.str.3:                               ; @.str.3
	.asciz	"/dev/cd0"

	.comm	_ENXIO,8,3                      ; @ENXIO
l_.str.4:                               ; @.str.4
	.asciz	"no disc in drive %s"

	.no_dead_strip	_open_cd
.subsections_via_symbols
