	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function open_disk
_open_disk:                             ## @open_disk
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_a_flag@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_I_flag@GOTPCREL(%rip), %rcx
	orq	(%rcx), %rax
	movq	_B_flag@GOTPCREL(%rip), %rcx
	orq	(%rcx), %rax
	setne	%al
	testl	%edi, %edi
	setne	%bl
	orb	%al, %bl
	movzbl	%bl, %esi
	movq	_disk@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_g_open
	movq	_fd@GOTPCREL(%rip), %r15
	movl	%eax, (%r15)
	cmpl	$-1, %eax
	je	LBB0_1
LBB0_6:
	xorl	%eax, %eax
	callq	_get_params
	cmpl	$-1, %eax
	je	LBB0_7
## %bb.8:
	movl	(%r15), %eax
	jmp	LBB0_9
LBB0_1:
	movq	_errno@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movq	_EPERM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	setne	%al
	xorb	$1, %bl
	orb	%al, %bl
	jne	LBB0_3
## %bb.2:
	movl	(%r14), %edi
	xorl	%esi, %esi
	callq	_g_open
	movl	%eax, (%r15)
	cmpl	$-1, %eax
	jne	LBB0_6
LBB0_3:
	movq	(%r12), %rcx
	movq	_ENXIO@GOTPCREL(%rip), %rdx
	movl	$-2, %eax
	cmpq	(%rdx), %rcx
	je	LBB0_9
## %bb.4:
	movl	(%r14), %esi
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_5
LBB0_7:
	movl	(%r14), %esi
	leaq	L_.str.1(%rip), %rdi
LBB0_5:
	callq	_warnx
	movl	$-1, %eax
LBB0_9:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_a_flag,8,3                     ## @a_flag
	.comm	_I_flag,8,3                     ## @I_flag
	.comm	_B_flag,8,3                     ## @B_flag
	.comm	_disk,4,2                       ## @disk
	.comm	_fd,4,2                         ## @fd
	.comm	_errno,8,3                      ## @errno
	.comm	_EPERM,8,3                      ## @EPERM
	.comm	_ENXIO,8,3                      ## @ENXIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"can't open device %s"

L_.str.1:                               ## @.str.1
	.asciz	"can't get disk parameters on %s"

	.no_dead_strip	_open_disk
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function open_disk
_open_disk:                             ; @open_disk
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
Lloh0:
	adrp	x8, _a_flag@GOTPAGE
Lloh1:
	ldr	x8, [x8, _a_flag@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _I_flag@GOTPAGE
Lloh4:
	ldr	x9, [x9, _I_flag@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	orr	x8, x8, x9
Lloh6:
	adrp	x9, _B_flag@GOTPAGE
Lloh7:
	ldr	x9, [x9, _B_flag@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	orr	x8, x8, x9
	cmp	w0, #0
	ccmp	x8, #0, #0, eq
	cset	w19, ne
Lloh9:
	adrp	x20, _disk@GOTPAGE
Lloh10:
	ldr	x20, [x20, _disk@GOTPAGEOFF]
	ldr	w0, [x20]
	mov	x1, x19
	bl	_g_open
Lloh11:
	adrp	x21, _fd@GOTPAGE
Lloh12:
	ldr	x21, [x21, _fd@GOTPAGEOFF]
	str	w0, [x21]
	cmn	w0, #1
	b.eq	LBB0_3
LBB0_1:
	bl	_get_params
	cmn	w0, #1
	b.eq	LBB0_7
; %bb.2:
	ldr	w0, [x21]
	b	LBB0_10
LBB0_3:
Lloh13:
	adrp	x22, _errno@GOTPAGE
Lloh14:
	ldr	x22, [x22, _errno@GOTPAGEOFF]
Lloh15:
	adrp	x8, _EPERM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
	ldr	x9, [x22]
Lloh17:
	ldr	x8, [x8]
	cmp	x9, x8
	cset	w8, ne
	eor	w9, w19, #0x1
	orr	w8, w9, w8
	tbnz	w8, #0, LBB0_5
; %bb.4:
	ldr	w0, [x20]
	mov	w1, #0
	bl	_g_open
	str	w0, [x21]
	cmn	w0, #1
	b.ne	LBB0_1
LBB0_5:
	ldr	x8, [x22]
Lloh18:
	adrp	x9, _ENXIO@GOTPAGE
Lloh19:
	ldr	x9, [x9, _ENXIO@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.6:
	mov	w0, #-2
	b	LBB0_10
LBB0_7:
	ldr	w1, [x20]
Lloh21:
	adrp	x0, l_.str.1@PAGE
Lloh22:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_9
LBB0_8:
	ldr	w1, [x20]
Lloh23:
	adrp	x0, l_.str@PAGE
Lloh24:
	add	x0, x0, l_.str@PAGEOFF
LBB0_9:
	bl	_warnx
	mov	w0, #-1
LBB0_10:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_a_flag,8,3                     ; @a_flag
	.comm	_I_flag,8,3                     ; @I_flag
	.comm	_B_flag,8,3                     ; @B_flag
	.comm	_disk,4,2                       ; @disk
	.comm	_fd,4,2                         ; @fd
	.comm	_errno,8,3                      ; @errno
	.comm	_EPERM,8,3                      ; @EPERM
	.comm	_ENXIO,8,3                      ; @ENXIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"can't open device %s"

l_.str.1:                               ; @.str.1
	.asciz	"can't get disk parameters on %s"

	.no_dead_strip	_open_disk
.subsections_via_symbols
