	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gluebi_create
_gluebi_create:                         ## @gluebi_create
	.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
	movq	%rsi, %rbx
	movq	%rdi, %r12
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movl	$80, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movq	%rax, %r15
	movl	48(%rbx), %edi
	movq	40(%rbx), %rsi
	incq	%rsi
	movl	(%r13), %edx
	callq	_kmemdup
	movq	%rax, 16(%r14)
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movl	24(%rbx), %eax
	movl	%eax, 76(%r15)
	movl	28(%rbx), %eax
	movl	%eax, 72(%r15)
	movq	_MTD_UBIVOLUME@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 68(%r15)
	cmpl	$0, 4(%r12)
	jne	LBB0_6
## %bb.5:
	movq	_MTD_WRITEABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 64(%r15)
LBB0_6:
	addq	$8, %r14
	movq	_THIS_MODULE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 60(%r15)
	movl	(%r12), %eax
	movl	%eax, 56(%r15)
	movq	32(%rbx), %rax
	movq	%rax, 48(%r15)
	movq	_gluebi_read@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 44(%r15)
	movq	_gluebi_write@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 40(%r15)
	movq	_gluebi_erase@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 36(%r15)
	movq	_gluebi_get_device@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 32(%r15)
	movq	_gluebi_put_device@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 28(%r15)
	movq	(%rbx), %rcx
	movq	_UBI_DYNAMIC_VOLUME@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_8
## %bb.7:
	imulq	8(%rbx), %rax
	jmp	LBB0_9
LBB0_3:
	movq	%r15, %rdi
	callq	_kfree
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_14
LBB0_8:
	movq	16(%rbx), %rax
LBB0_9:
	movq	%rax, (%r14)
	movq	_devices_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movl	24(%rbx), %esi
	movl	28(%rbx), %edi
	callq	_find_gluebi_nolock
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movl	24(%rax), %esi
	movl	24(%rbx), %ecx
	movl	28(%rbx), %edx
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_err_msg
LBB0_11:
	movq	_devices_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	movq	%r14, %rdi
	callq	_add_mtd_device
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_err_msg
	movq	16(%r15), %rdi
	callq	_kfree
	movq	%r15, %rdi
	callq	_kfree
	movq	_ENFILE@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_14
LBB0_13:
	movq	_devices_mutex@GOTPCREL(%rip), %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	_gluebi_devices@GOTPCREL(%rip), %rsi
	movq	%r15, %rdi
	callq	_list_add_tail
	movq	%rbx, %rdi
	callq	_mutex_unlock
	xorl	%ebx, %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_MTD_UBIVOLUME,4,2              ## @MTD_UBIVOLUME
	.comm	_MTD_WRITEABLE,4,2              ## @MTD_WRITEABLE
	.comm	_THIS_MODULE,4,2                ## @THIS_MODULE
	.comm	_gluebi_read,4,2                ## @gluebi_read
	.comm	_gluebi_write,4,2               ## @gluebi_write
	.comm	_gluebi_erase,4,2               ## @gluebi_erase
	.comm	_gluebi_get_device,4,2          ## @gluebi_get_device
	.comm	_gluebi_put_device,4,2          ## @gluebi_put_device
	.comm	_UBI_DYNAMIC_VOLUME,8,3         ## @UBI_DYNAMIC_VOLUME
	.comm	_devices_mutex,4,2              ## @devices_mutex
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"gluebi MTD device %d form UBI device %d volume %d already exists"

L_.str.1:                               ## @.str.1
	.asciz	"cannot add MTD device"

	.comm	_ENFILE,4,2                     ## @ENFILE
	.comm	_gluebi_devices,4,2             ## @gluebi_devices
	.no_dead_strip	_gluebi_create
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gluebi_create
_gluebi_create:                         ; @gluebi_create
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x1
	mov	x22, x0
Lloh0:
	adrp	x21, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x21, [x21, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	w0, #80
	bl	_kzalloc
	cbz	x0, LBB0_7
; %bb.1:
	mov	x19, x0
	ldr	w0, [x20, #48]
	ldr	x8, [x20, #40]
	add	x1, x8, #1
	ldr	w2, [x21]
	bl	_kmemdup
	str	x0, [x19, #16]
	cbz	x0, LBB0_6
; %bb.2:
	ldr	d0, [x20, #24]
	rev64.2s	v0, v0
	str	d0, [x19, #72]
Lloh2:
	adrp	x8, _MTD_UBIVOLUME@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MTD_UBIVOLUME@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	str	w8, [x19, #68]
	ldr	w8, [x22, #4]
	cbnz	w8, LBB0_4
; %bb.3:
Lloh5:
	adrp	x8, _MTD_WRITEABLE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MTD_WRITEABLE@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	str	w8, [x19, #64]
LBB0_4:
Lloh8:
	adrp	x8, _THIS_MODULE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _THIS_MODULE@GOTPAGEOFF]
	add	x21, x19, #8
Lloh10:
	ldr	w8, [x8]
	ldr	w9, [x22]
	stp	w9, w8, [x19, #56]
	ldr	x8, [x20, #32]
Lloh11:
	adrp	x9, _gluebi_read@GOTPAGE
Lloh12:
	ldr	x9, [x9, _gluebi_read@GOTPAGEOFF]
	str	x8, [x19, #48]
Lloh13:
	ldr	w9, [x9]
	str	w9, [x19, #44]
Lloh14:
	adrp	x9, _gluebi_write@GOTPAGE
Lloh15:
	ldr	x9, [x9, _gluebi_write@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
Lloh17:
	adrp	x10, _gluebi_erase@GOTPAGE
Lloh18:
	ldr	x10, [x10, _gluebi_erase@GOTPAGEOFF]
Lloh19:
	ldr	w10, [x10]
Lloh20:
	adrp	x11, _gluebi_get_device@GOTPAGE
Lloh21:
	ldr	x11, [x11, _gluebi_get_device@GOTPAGEOFF]
	stp	w10, w9, [x19, #36]
Lloh22:
	ldr	w9, [x11]
Lloh23:
	adrp	x10, _gluebi_put_device@GOTPAGE
Lloh24:
	ldr	x10, [x10, _gluebi_put_device@GOTPAGEOFF]
Lloh25:
	ldr	w10, [x10]
	stp	w10, w9, [x19, #28]
	ldr	x9, [x20]
Lloh26:
	adrp	x10, _UBI_DYNAMIC_VOLUME@GOTPAGE
Lloh27:
	ldr	x10, [x10, _UBI_DYNAMIC_VOLUME@GOTPAGEOFF]
Lloh28:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_8
; %bb.5:
	ldr	x9, [x20, #8]
	mul	x8, x9, x8
	b	LBB0_9
LBB0_6:
	mov	x0, x19
	bl	_kfree
LBB0_7:
Lloh29:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh30:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_13
LBB0_8:
	ldr	x8, [x20, #16]
LBB0_9:
	str	x8, [x21]
Lloh31:
	adrp	x0, _devices_mutex@GOTPAGE
Lloh32:
	ldr	x0, [x0, _devices_mutex@GOTPAGEOFF]
	bl	_mutex_lock
	ldp	w1, w0, [x20, #24]
	bl	_find_gluebi_nolock
	cbz	x0, LBB0_11
; %bb.10:
	ldr	w8, [x0, #24]
	ldp	w10, w9, [x20, #24]
	stp	x9, x10, [sp, #8]
	str	x8, [sp]
Lloh33:
	adrp	x0, l_.str@PAGE
Lloh34:
	add	x0, x0, l_.str@PAGEOFF
	bl	_err_msg
LBB0_11:
Lloh35:
	adrp	x0, _devices_mutex@GOTPAGE
Lloh36:
	ldr	x0, [x0, _devices_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
	mov	x0, x21
	bl	_add_mtd_device
	cbz	x0, LBB0_15
; %bb.12:
Lloh37:
	adrp	x0, l_.str.1@PAGE
Lloh38:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_err_msg
	ldr	x0, [x19, #16]
	bl	_kfree
	mov	x0, x19
	bl	_kfree
Lloh39:
	adrp	x8, _ENFILE@GOTPAGE
Lloh40:
	ldr	x8, [x8, _ENFILE@GOTPAGEOFF]
LBB0_13:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_14:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_15:
Lloh41:
	adrp	x20, _devices_mutex@GOTPAGE
Lloh42:
	ldr	x20, [x20, _devices_mutex@GOTPAGEOFF]
	mov	x0, x20
	bl	_mutex_lock
Lloh43:
	adrp	x1, _gluebi_devices@GOTPAGE
Lloh44:
	ldr	x1, [x1, _gluebi_devices@GOTPAGEOFF]
	mov	x0, x19
	bl	_list_add_tail
	mov	x0, x20
	bl	_mutex_unlock
	mov	w0, #0
	b	LBB0_14
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh43, Lloh44
	.loh AdrpLdrGot	Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_MTD_UBIVOLUME,4,2              ; @MTD_UBIVOLUME
	.comm	_MTD_WRITEABLE,4,2              ; @MTD_WRITEABLE
	.comm	_THIS_MODULE,4,2                ; @THIS_MODULE
	.comm	_gluebi_read,4,2                ; @gluebi_read
	.comm	_gluebi_write,4,2               ; @gluebi_write
	.comm	_gluebi_erase,4,2               ; @gluebi_erase
	.comm	_gluebi_get_device,4,2          ; @gluebi_get_device
	.comm	_gluebi_put_device,4,2          ; @gluebi_put_device
	.comm	_UBI_DYNAMIC_VOLUME,8,3         ; @UBI_DYNAMIC_VOLUME
	.comm	_devices_mutex,4,2              ; @devices_mutex
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"gluebi MTD device %d form UBI device %d volume %d already exists"

l_.str.1:                               ; @.str.1
	.asciz	"cannot add MTD device"

	.comm	_ENFILE,4,2                     ; @ENFILE
	.comm	_gluebi_devices,4,2             ; @gluebi_devices
	.no_dead_strip	_gluebi_create
.subsections_via_symbols
