	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function disk_open
_disk_open:                             ## @disk_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	_ndisks@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	movq	_NDISKS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jae	LBB0_3
## %bb.1:
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_open
	testl	%eax, %eax
	js	LBB0_4
## %bb.2:
	movq	_disk_fd@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rbx), %rdx
	movl	%eax, (%rcx,%rdx,4)
	incq	%rdx
	movq	%rdx, (%rbx)
	xorl	%eax, %eax
	jmp	LBB0_6
LBB0_3:
	movq	_ERANGE@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_4:
	movq	_errno@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ndisks,8,3                     ## @ndisks
	.comm	_NDISKS,8,3                     ## @NDISKS
	.comm	_ERANGE,4,2                     ## @ERANGE
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_errno,4,2                      ## @errno
	.comm	_disk_fd,8,3                    ## @disk_fd
	.no_dead_strip	_disk_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function disk_open
_disk_open:                             ; @disk_open
	.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
Lloh0:
	adrp	x19, _ndisks@GOTPAGE
Lloh1:
	ldr	x19, [x19, _ndisks@GOTPAGEOFF]
	ldr	x8, [x19]
Lloh2:
	adrp	x9, _NDISKS@GOTPAGE
Lloh3:
	ldr	x9, [x9, _NDISKS@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.hs	LBB0_3
; %bb.1:
Lloh5:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	bl	_open
	tbnz	w0, #31, LBB0_4
; %bb.2:
	mov	x8, x0
	mov	w0, #0
Lloh8:
	adrp	x9, _disk_fd@GOTPAGE
Lloh9:
	ldr	x9, [x9, _disk_fd@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	ldr	x10, [x19]
	str	w8, [x9, x10, lsl #2]
	add	x8, x10, #1
	str	x8, [x19]
	b	LBB0_6
LBB0_3:
Lloh11:
	adrp	x8, _ERANGE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ERANGE@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:
Lloh13:
	adrp	x8, _errno@GOTPAGE
Lloh14:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
LBB0_5:
	ldr	w0, [x8]
LBB0_6:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_ndisks,8,3                     ; @ndisks
	.comm	_NDISKS,8,3                     ; @NDISKS
	.comm	_ERANGE,4,2                     ; @ERANGE
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_errno,4,2                      ; @errno
	.comm	_disk_fd,8,3                    ; @disk_fd
	.no_dead_strip	_disk_open
.subsections_via_symbols
