	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtdchar_blkpg_ioctl
_mtdchar_blkpg_ioctl:                   ## @mtdchar_blkpg_ioctl
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	_CAP_SYS_ADMIN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_capable
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movl	4(%rbx), %esi
	leaq	-40(%rbp), %rdi
	movl	$24, %edx
	callq	_copy_from_user
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_EFAULT@GOTPCREL(%rip), %rcx
	jmp	LBB0_11
LBB0_1:
	movq	_EPERM@GOTPCREL(%rip), %rcx
	jmp	LBB0_11
LBB0_4:
	movl	(%rbx), %eax
	cmpl	$128, %eax
	je	LBB0_8
## %bb.5:
	cmpl	$129, %eax
	jne	LBB0_10
## %bb.6:
	movq	%r14, %rdi
	callq	_mtd_is_partition
	testl	%eax, %eax
	jne	LBB0_10
## %bb.7:
	movq	-40(%rbp), %rax
	movq	_BLKPG_DEVNAMELTH@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	movb	$0, -1(%rcx,%rax)
	movq	-40(%rbp), %rsi
	movl	-24(%rbp), %edx
	movl	-28(%rbp), %ecx
	movq	%r14, %rdi
	callq	_mtd_add_partition
	jmp	LBB0_12
LBB0_8:
	movl	-32(%rbp), %esi
	testl	%esi, %esi
	js	LBB0_10
## %bb.9:
	movq	%r14, %rdi
	callq	_mtd_del_partition
	jmp	LBB0_12
LBB0_10:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_11:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_12:
	addq	$32, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CAP_SYS_ADMIN,4,2              ## @CAP_SYS_ADMIN
	.comm	_EPERM,4,2                      ## @EPERM
	.comm	_EFAULT,4,2                     ## @EFAULT
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_BLKPG_DEVNAMELTH,4,2           ## @BLKPG_DEVNAMELTH
	.no_dead_strip	_mtdchar_blkpg_ioctl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtdchar_blkpg_ioctl
_mtdchar_blkpg_ioctl:                   ; @mtdchar_blkpg_ioctl
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _CAP_SYS_ADMIN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CAP_SYS_ADMIN@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_capable
	cbz	w0, LBB0_3
; %bb.1:
	ldr	w1, [x20, #4]
	add	x0, sp, #8
	mov	w2, #24
	bl	_copy_from_user
	cbz	x0, LBB0_4
; %bb.2:
Lloh3:
	adrp	x8, _EFAULT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
	b	LBB0_11
LBB0_3:
Lloh5:
	adrp	x8, _EPERM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
	b	LBB0_11
LBB0_4:
	ldr	w8, [x20]
	cmp	w8, #128
	b.eq	LBB0_8
; %bb.5:
	cmp	w8, #129
	b.ne	LBB0_10
; %bb.6:
	mov	x0, x19
	bl	_mtd_is_partition
	cbnz	w0, LBB0_10
; %bb.7:
	ldr	x8, [sp, #8]
Lloh7:
	adrp	x9, _BLKPG_DEVNAMELTH@GOTPAGE
Lloh8:
	ldr	x9, [x9, _BLKPG_DEVNAMELTH@GOTPAGEOFF]
Lloh9:
	ldrsw	x9, [x9]
	add	x8, x9, x8
	sturb	wzr, [x8, #-1]
	ldr	x1, [sp, #8]
	ldp	w3, w2, [sp, #20]
	mov	x0, x19
	bl	_mtd_add_partition
	b	LBB0_12
LBB0_8:
	ldr	w1, [sp, #16]
	tbnz	w1, #31, LBB0_10
; %bb.9:
	mov	x0, x19
	bl	_mtd_del_partition
	b	LBB0_12
LBB0_10:
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_12:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_CAP_SYS_ADMIN,4,2              ; @CAP_SYS_ADMIN
	.comm	_EPERM,4,2                      ; @EPERM
	.comm	_EFAULT,4,2                     ; @EFAULT
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_BLKPG_DEVNAMELTH,4,2           ; @BLKPG_DEVNAMELTH
	.no_dead_strip	_mtdchar_blkpg_ioctl
.subsections_via_symbols
