	.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	_O_CREAT@GOTPCREL(%rip), %rcx
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%rcx), %eax
	movq	%rdx, %r15
	movq	%rsi, %r14
	movq	%rdi, %r12
	movq	_O_TRUNC@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	%rsi, %rdi
	movl	%eax, %esi
	movl	$384, %edx                      ## imm = 0x180
	callq	_open
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movl	%eax, %ebx
	movl	%eax, %edi
	movq	%r15, %rsi
	callq	_ftruncate
	testq	%rax, %rax
	js	LBB0_4
## %bb.3:
	movq	_RUMP_ETFS_BLK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movq	%r14, %rsi
	xorl	%ecx, %ecx
	movq	%r15, %r8
	callq	_rump_pub_etfs_register_withsize
	testq	%rax, %rax
	jns	LBB0_5
LBB0_4:
	movl	%ebx, %edi
	callq	_close
	movl	$-1, %ebx
LBB0_5:
	movq	%r14, %rdi
	callq	_unlink
	jmp	LBB0_6
LBB0_1:
	movl	$-1, %ebx
LBB0_6:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_O_TRUNC,4,2                    ## @O_TRUNC
	.comm	_RUMP_ETFS_BLK,4,2              ## @RUMP_ETFS_BLK
	.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
	mov	x21, x2
	mov	x19, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _O_CREAT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _O_CREAT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _O_RDWR@GOTPAGE
Lloh4:
	ldr	x9, [x9, _O_RDWR@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh6:
	adrp	x9, _O_TRUNC@GOTPAGE
Lloh7:
	ldr	x9, [x9, _O_TRUNC@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w1, w8, w9
	mov	x0, x19
	mov	w2, #384
	bl	_open
	tbnz	w0, #31, LBB0_5
; %bb.1:
	mov	x20, x0
	mov	x1, x21
	bl	_ftruncate
	tbnz	x0, #63, LBB0_3
; %bb.2:
Lloh9:
	adrp	x8, _RUMP_ETFS_BLK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _RUMP_ETFS_BLK@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x0, x22
	mov	x1, x19
	mov	w3, #0
	mov	x4, x21
	bl	_rump_pub_etfs_register_withsize
	tbz	x0, #63, LBB0_4
LBB0_3:
	mov	x0, x20
	bl	_close
	mov	w20, #-1
LBB0_4:
	mov	x0, x19
	bl	_unlink
	b	LBB0_6
LBB0_5:
	mov	w20, #-1
LBB0_6:
	mov	x0, x20
	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 AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_O_TRUNC,4,2                    ; @O_TRUNC
	.comm	_RUMP_ETFS_BLK,4,2              ; @RUMP_ETFS_BLK
	.no_dead_strip	_open_disk
.subsections_via_symbols
