	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_attach                     ## -- Begin function ubi_attach
	.p2align	4, 0x90
_ubi_attach:                            ## @ubi_attach
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_alloc_ai
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	movq	%r14, %rdi
	movq	%rax, %rsi
	xorl	%edx, %edx
	callq	_scan_all
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_9
## %bb.3:
	movq	16(%r15), %rax
	movq	%rax, 32(%r14)
	movq	40(%r14), %rcx
	subq	%rax, %rcx
	movq	%rcx, 48(%r14)
	movl	12(%r15), %eax
	movl	%eax, 24(%r14)
	movl	8(%r15), %eax
	movl	%eax, 20(%r14)
	movl	4(%r15), %eax
	movl	%eax, 16(%r14)
	movl	(%r15), %esi
	leaq	L_.str(%rip), %rdi
	callq	_dbg_gen
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_ubi_read_volume_table
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_9
## %bb.4:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_ubi_wl_init
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_8
## %bb.5:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_ubi_eba_init
	testl	%eax, %eax
	je	LBB0_6
## %bb.7:
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_ubi_wl_close
LBB0_8:
	movq	%r14, %rdi
	callq	_ubi_free_internal_volumes
	movl	4(%r14), %edi
	callq	_vfree
LBB0_9:
	movq	%r15, %rdi
	callq	_destroy_ai
	jmp	LBB0_10
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	%r15, %rdi
	callq	_destroy_ai
	xorl	%ebx, %ebx
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"max. sequence number:       %llu"

	.comm	_UBI_FM_MAX_START,4,2           ## @UBI_FM_MAX_START
	.comm	_UBI_NO_FASTMAP,4,2             ## @UBI_NO_FASTMAP
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_attach                     ; -- Begin function ubi_attach
	.p2align	2
_ubi_attach:                            ; @ubi_attach
	.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	x20, x0
	bl	_alloc_ai
	cbz	x0, LBB0_8
; %bb.1:
	mov	x19, x0
	mov	x0, x20
	mov	x1, x19
	mov	w2, #0
	bl	_scan_all
	mov	x21, x0
	cbnz	w0, LBB0_7
; %bb.2:
	ldr	x8, [x19, #16]
	str	x8, [x20, #32]
	ldr	x9, [x20, #40]
	sub	x8, x9, x8
	str	x8, [x20, #48]
	ldr	w8, [x19, #12]
	str	w8, [x20, #24]
	ldur	d0, [x19, #4]
	str	d0, [x20, #16]
	ldr	w1, [x19]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dbg_gen
	mov	x0, x20
	mov	x1, x19
	bl	_ubi_read_volume_table
	mov	x21, x0
	cbnz	w0, LBB0_7
; %bb.3:
	mov	x0, x20
	mov	x1, x19
	bl	_ubi_wl_init
	mov	x21, x0
	cbnz	w0, LBB0_6
; %bb.4:
	mov	x0, x20
	mov	x1, x19
	bl	_ubi_eba_init
	mov	x21, x0
	cbz	w0, LBB0_7
; %bb.5:
	mov	x0, x20
	bl	_ubi_wl_close
LBB0_6:
	mov	x0, x20
	bl	_ubi_free_internal_volumes
	ldr	w0, [x20, #4]
	bl	_vfree
LBB0_7:
	mov	x0, x19
	bl	_destroy_ai
	b	LBB0_9
LBB0_8:
Lloh2:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_9:
	mov	x0, x21
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"max. sequence number:       %llu"

	.comm	_UBI_FM_MAX_START,4,2           ; @UBI_FM_MAX_START
	.comm	_UBI_NO_FASTMAP,4,2             ; @UBI_NO_FASTMAP
.subsections_via_symbols
