	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ide_gd_open
_ide_gd_open:                           ## @ide_gd_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	(%rdi), %r15
	movq	%r15, %rdi
	callq	_ide_disk_get
	testq	%rax, %rax
	je	LBB0_8
## %bb.1:
	movq	%rax, %r13
	movq	8(%rax), %r12
	movq	_IDE_DBG_FUNC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_ide_debug_log
	movl	(%r13), %edx
	leal	1(%rdx), %eax
	movl	%eax, (%r13)
	movl	(%r12), %eax
	movq	_IDE_DFLAG_REMOVABLE@GOTPCREL(%rip), %rsi
	movq	_IDE_DFLAG_FORMAT_IN_PROGRESS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%eax, (%rsi)
	je	LBB0_9
## %bb.2:
	testl	%edx, %edx
	jne	LBB0_9
## %bb.3:
	notl	%ecx
	andl	%ecx, %eax
	movl	%eax, (%r12)
	movq	8(%r12), %rax
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	*(%rax)
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movq	_FMODE_NDELAY@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_13
LBB0_5:
	movq	_IDE_DFLAG_WP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	je	LBB0_11
## %bb.6:
	movq	_FMODE_WRITE@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_11
## %bb.7:
	movq	_EROFS@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_8:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_15
LBB0_9:
	testl	%eax, %ecx
	je	LBB0_12
## %bb.10:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_11:
	movq	8(%r12), %rax
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	$1, %edx
	callq	*8(%rax)
	movq	_IDE_DFLAG_MEDIA_CHANGED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r12)
	movq	%r14, %rdi
	callq	_check_disk_change
LBB0_12:
	xorl	%ebx, %ebx
	jmp	LBB0_15
LBB0_13:
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_14:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	decl	(%r13)
	movq	%r13, %rdi
	callq	_ide_disk_put
LBB0_15:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_IDE_DBG_FUNC,4,2               ## @IDE_DBG_FUNC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"enter"

	.comm	_IDE_DFLAG_REMOVABLE,4,2        ## @IDE_DFLAG_REMOVABLE
	.comm	_IDE_DFLAG_FORMAT_IN_PROGRESS,4,2 ## @IDE_DFLAG_FORMAT_IN_PROGRESS
	.comm	_FMODE_NDELAY,4,2               ## @FMODE_NDELAY
	.comm	_EIO,4,2                        ## @EIO
	.comm	_IDE_DFLAG_WP,4,2               ## @IDE_DFLAG_WP
	.comm	_FMODE_WRITE,4,2                ## @FMODE_WRITE
	.comm	_EROFS,4,2                      ## @EROFS
	.comm	_IDE_DFLAG_MEDIA_CHANGED,4,2    ## @IDE_DFLAG_MEDIA_CHANGED
	.comm	_EBUSY,4,2                      ## @EBUSY
	.no_dead_strip	_ide_gd_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ide_gd_open
_ide_gd_open:                           ; @ide_gd_open
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x23, x1
	mov	x20, x0
	ldr	x21, [x0]
	mov	x0, x21
	bl	_ide_disk_get
	cbz	x0, LBB0_4
; %bb.1:
	mov	x19, x0
	ldr	x22, [x0, #8]
Lloh0:
	adrp	x8, _IDE_DBG_FUNC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IDE_DBG_FUNC@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_ide_debug_log
	ldr	w10, [x19]
	add	w8, w10, #1
	str	w8, [x19]
	ldr	w8, [x22]
Lloh5:
	adrp	x9, _IDE_DFLAG_REMOVABLE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _IDE_DFLAG_REMOVABLE@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	and	w11, w9, w8
Lloh8:
	adrp	x9, _IDE_DFLAG_FORMAT_IN_PROGRESS@GOTPAGE
Lloh9:
	ldr	x9, [x9, _IDE_DFLAG_FORMAT_IN_PROGRESS@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	cmp	w11, #0
	ccmp	w10, #0, #0, ne
	b.eq	LBB0_5
; %bb.2:
	tst	w9, w8
	b.eq	LBB0_11
; %bb.3:
Lloh11:
	adrp	x8, _EBUSY@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_13
LBB0_4:
Lloh13:
	adrp	x8, _ENXIO@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_14
LBB0_5:
	bic	w8, w8, w9
	str	w8, [x22]
	ldr	x8, [x22, #8]
	ldr	x8, [x8]
	mov	x0, x22
	mov	x1, x21
	blr	x8
	cbz	w0, LBB0_7
; %bb.6:
Lloh16:
	adrp	x8, _FMODE_NDELAY@GOTPAGE
Lloh17:
	ldr	x8, [x8, _FMODE_NDELAY@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	tst	w8, w23
	b.eq	LBB0_12
LBB0_7:
	ldr	w8, [x22]
Lloh19:
	adrp	x9, _IDE_DFLAG_WP@GOTPAGE
Lloh20:
	ldr	x9, [x9, _IDE_DFLAG_WP@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.8:
Lloh22:
	adrp	x8, _FMODE_WRITE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _FMODE_WRITE@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	tst	w8, w23
	b.eq	LBB0_10
; %bb.9:
Lloh25:
	adrp	x8, _EROFS@GOTPAGE
Lloh26:
	ldr	x8, [x8, _EROFS@GOTPAGEOFF]
	b	LBB0_13
LBB0_10:
	ldr	x8, [x22, #8]
	ldr	x8, [x8, #8]
	mov	x0, x22
	mov	x1, x21
	mov	w2, #1
	blr	x8
Lloh27:
	adrp	x8, _IDE_DFLAG_MEDIA_CHANGED@GOTPAGE
Lloh28:
	ldr	x8, [x8, _IDE_DFLAG_MEDIA_CHANGED@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	ldr	w9, [x22]
	orr	w8, w9, w8
	str	w8, [x22]
	mov	x0, x20
	bl	_check_disk_change
LBB0_11:
	mov	w20, #0
	b	LBB0_14
LBB0_12:
Lloh30:
	adrp	x8, _EIO@GOTPAGE
Lloh31:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_13:
	ldr	w8, [x8]
	neg	w20, w8
	ldr	w8, [x19]
	sub	w8, w8, #1
	str	w8, [x19]
	mov	x0, x19
	bl	_ide_disk_put
LBB0_14:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_IDE_DBG_FUNC,4,2               ; @IDE_DBG_FUNC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"enter"

	.comm	_IDE_DFLAG_REMOVABLE,4,2        ; @IDE_DFLAG_REMOVABLE
	.comm	_IDE_DFLAG_FORMAT_IN_PROGRESS,4,2 ; @IDE_DFLAG_FORMAT_IN_PROGRESS
	.comm	_FMODE_NDELAY,4,2               ; @FMODE_NDELAY
	.comm	_EIO,4,2                        ; @EIO
	.comm	_IDE_DFLAG_WP,4,2               ; @IDE_DFLAG_WP
	.comm	_FMODE_WRITE,4,2                ; @FMODE_WRITE
	.comm	_EROFS,4,2                      ; @EROFS
	.comm	_IDE_DFLAG_MEDIA_CHANGED,4,2    ; @IDE_DFLAG_MEDIA_CHANGED
	.comm	_EBUSY,4,2                      ; @EBUSY
	.no_dead_strip	_ide_gd_open
.subsections_via_symbols
