	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtd_unlock
_mtd_unlock:                            ## @mtd_unlock
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movl	$58, %esi
	callq	_strchr
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%r13, %rdi
	callq	_strdup
	movq	%rax, %r13
	movq	%rax, %rcx
	jmp	LBB0_3
LBB0_1:
	xorl	%eax, %eax
LBB0_3:
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_MEMUNLOCK@GOTPCREL(%rip), %r15
	leaq	-64(%rbp), %r12
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	$0, -56(%rbp)
	movq	_mtdsize@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)
	movl	(%r15), %esi
	movl	%r14d, %edi
	movq	%r12, %rdx
	callq	_ioctl
	movl	%r14d, %edi
	callq	_close
	movq	%rbx, %r13
	testq	%rbx, %rbx
	je	LBB0_11
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	movl	$58, %esi
	callq	_strchr
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rax, %rbx
	movb	$0, (%rax)
	incq	%rbx
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_4 Depth=1
	xorl	%ebx, %ebx
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%r13, %rdi
	callq	_mtd_check_open
	testl	%eax, %eax
	js	LBB0_14
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	%eax, %r14d
	movq	_quiet@GOTPCREL(%rip), %rax
	cmpl	$1, (%rax)
	jg	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	movq	%r13, %rdx
	callq	_fprintf
	jmp	LBB0_10
LBB0_11:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	testq	%rdi, %rdi
	je	LBB0_13
## %bb.12:
	callq	_free
LBB0_13:
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdx
	callq	_fprintf
	movl	$1, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Could not open mtd device: %s\n"

	.comm	_quiet,4,2                      ## @quiet
L_.str.1:                               ## @.str.1
	.asciz	"Unlocking %s ...\n"

	.comm	_mtdsize,4,2                    ## @mtdsize
	.comm	_MEMUNLOCK,4,2                  ## @MEMUNLOCK
	.no_dead_strip	_mtd_unlock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtd_unlock
_mtd_unlock:                            ; @mtd_unlock
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x0
	mov	w1, #58
	bl	_strchr
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x20
	bl	_strdup
	mov	x19, x0
	mov	x20, x0
	b	LBB0_3
LBB0_2:
	mov	x19, #0
LBB0_3:
Lloh0:
	adrp	x25, _quiet@GOTPAGE
Lloh1:
	ldr	x25, [x25, _quiet@GOTPAGEOFF]
Lloh2:
	adrp	x24, _stderr@GOTPAGE
Lloh3:
	ldr	x24, [x24, _stderr@GOTPAGEOFF]
Lloh4:
	adrp	x21, l_.str.1@PAGE
Lloh5:
	add	x21, x21, l_.str.1@PAGEOFF
Lloh6:
	adrp	x26, _mtdsize@GOTPAGE
Lloh7:
	ldr	x26, [x26, _mtdsize@GOTPAGEOFF]
Lloh8:
	adrp	x27, _MEMUNLOCK@GOTPAGE
Lloh9:
	ldr	x27, [x27, _MEMUNLOCK@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	str	xzr, [sp, #8]
	ldr	w8, [x26]
	str	w8, [sp]
	ldr	w1, [x27]
	mov	x2, sp
	mov	x0, x23
	bl	_ioctl
	mov	x0, x23
	bl	_close
	mov	x20, x22
	cbz	x22, LBB0_10
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	w1, #58
	bl	_strchr
	mov	x22, x0
	cbz	x0, LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	strb	wzr, [x22], #1
LBB0_7:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x20
	bl	_mtd_check_open
	tbnz	w0, #31, LBB0_13
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x23, x0
	ldr	w8, [x25]
	cmp	w8, #1
	b.gt	LBB0_4
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x24]
	mov	x1, x21
	mov	x2, x20
	bl	_fprintf
	b	LBB0_4
LBB0_10:
	cbz	x19, LBB0_12
; %bb.11:
	mov	x0, x19
	bl	_free
LBB0_12:
	mov	w0, #0
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_13:
	ldr	w0, [x24]
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_fprintf
	mov	w0, #1
	bl	_exit
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Could not open mtd device: %s\n"

	.comm	_quiet,4,2                      ; @quiet
l_.str.1:                               ; @.str.1
	.asciz	"Unlocking %s ...\n"

	.comm	_mtdsize,4,2                    ; @mtdsize
	.comm	_MEMUNLOCK,4,2                  ; @MEMUNLOCK
	.no_dead_strip	_mtd_unlock
.subsections_via_symbols
