	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nvram_find_mtd                 ## -- Begin function nvram_find_mtd
	.p2align	4, 0x90
_nvram_find_mtd:                        ## @nvram_find_mtd
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsp, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_PATH_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	%r15, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	leaq	L_.str(%rip), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movq	%rax, %rdx
	callq	_fgets
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	leaq	L_.str.2(%rip), %r12
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movq	%r14, %rdx
	callq	_fgets
	testq	%rax, %rax
	je	LBB0_12
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_strstr
	testq	%rax, %rax
	je	LBB0_11
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%rbx, %rdi
	leaq	L_.str.3(%rip), %rsi
	leaq	-64(%rbp), %rdx
	leaq	-60(%rbp), %rcx
	callq	_sscanf
	testq	%rax, %rax
	je	LBB0_11
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	-60(%rbp), %eax
	movq	_nvram_part_size@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movl	-64(%rbp), %edx
	movq	%rbx, %rdi
	leaq	L_.str.4(%rip), %rsi
	callq	_sprintf
	movq	%rbx, %rdi
	leaq	-56(%rbp), %rsi
	callq	_stat
	testl	%eax, %eax
	js	LBB0_11
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	_S_IFBLK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -56(%rbp)
	je	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%rbx, %rdi
	callq	_strlen
	leaq	1(%rax), %rdi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movq	%rax, %r13
	movq	%rbx, %rdi
	callq	_strlen
	leaq	1(%rax), %rdx
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_strncpy
	jmp	LBB0_13
LBB0_1:
	xorl	%r13d, %r13d
	jmp	LBB0_15
LBB0_12:
	xorl	%r13d, %r13d
LBB0_13:
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_14
LBB0_3:
	xorl	%r13d, %r13d
LBB0_14:
	movq	%r14, %rdi
	callq	_fclose
LBB0_15:
	movq	%r12, %rsp
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_17
## %bb.16:
	movq	%r13, %rax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_PATH_MAX,4,2                   ## @PATH_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"/proc/mtd"

L_.str.1:                               ## @.str.1
	.asciz	"r"

L_.str.2:                               ## @.str.2
	.asciz	"nvram"

L_.str.3:                               ## @.str.3
	.asciz	"mtd%d: %08x"

	.comm	_nvram_part_size,4,2            ## @nvram_part_size
L_.str.4:                               ## @.str.4
	.asciz	"/dev/mtdblock%d"

	.comm	_S_IFBLK,4,2                    ## @S_IFBLK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nvram_find_mtd                 ; -- Begin function nvram_find_mtd
	.p2align	2
_nvram_find_mtd:                        ; @nvram_find_mtd
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	sub	sp, sp, #32
	mov	x26, sp
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x8, _PATH_MAX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PATH_MAX@GOTPAGEOFF]
Lloh5:
	ldr	w21, [x8]
	mov	x9, x21
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x21, #15
	and	x9, x9, #0x1fffffff0
	sub	x20, x8, x9
	mov	sp, x20
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_fopen
	cbz	x0, LBB0_12
; %bb.1:
	mov	x19, x0
	mov	x0, x20
	mov	x1, x21
	mov	x2, x19
	bl	_fgets
	cbz	x0, LBB0_10
; %bb.2:
Lloh12:
	adrp	x22, l_.str.2@PAGE
Lloh13:
	add	x22, x22, l_.str.2@PAGEOFF
Lloh14:
	adrp	x23, l_.str.3@PAGE
Lloh15:
	add	x23, x23, l_.str.3@PAGEOFF
Lloh16:
	adrp	x27, _nvram_part_size@GOTPAGE
Lloh17:
	ldr	x27, [x27, _nvram_part_size@GOTPAGEOFF]
Lloh18:
	adrp	x28, _S_IFBLK@GOTPAGE
Lloh19:
	ldr	x28, [x28, _S_IFBLK@GOTPAGEOFF]
Lloh20:
	adrp	x24, l_.str.4@PAGE
Lloh21:
	add	x24, x24, l_.str.4@PAGEOFF
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x20
	mov	x1, x21
	mov	x2, x19
	bl	_fgets
	cbz	x0, LBB0_10
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x22
	bl	_strstr
	cbz	x0, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	sub	x2, x29, #92
	sub	x3, x29, #96
	mov	x0, x20
	mov	x1, x23
	bl	_sscanf
	cbz	x0, LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldp	w8, w2, [x29, #-96]
	str	w8, [x27]
	mov	x0, x20
	mov	x1, x24
	bl	_sprintf
	sub	x1, x29, #104
	mov	x0, x20
	bl	_stat
	tbnz	w0, #31, LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	ldur	w8, [x29, #-104]
	ldr	w9, [x28]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x20
	bl	_strlen
	add	x0, x0, #1
	bl	_malloc
	cbz	x0, LBB0_3
; %bb.9:
	mov	x25, x0
	mov	x0, x20
	bl	_strlen
	add	x2, x0, #1
	mov	x0, x25
	mov	x1, x20
	bl	_strncpy
	b	LBB0_11
LBB0_10:
	mov	x25, #0
LBB0_11:
	mov	x0, x19
	bl	_fclose
	b	LBB0_13
LBB0_12:
	mov	x25, #0
LBB0_13:
	mov	sp, x26
	ldur	x8, [x29, #-88]
Lloh22:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh23:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh24:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_15
; %bb.14:
	mov	x0, x25
	sub	sp, x29, #80
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_15:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_PATH_MAX,4,2                   ; @PATH_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"/proc/mtd"

l_.str.1:                               ; @.str.1
	.asciz	"r"

l_.str.2:                               ; @.str.2
	.asciz	"nvram"

l_.str.3:                               ; @.str.3
	.asciz	"mtd%d: %08x"

	.comm	_nvram_part_size,4,2            ; @nvram_part_size
l_.str.4:                               ; @.str.4
	.asciz	"/dev/mtdblock%d"

	.comm	_S_IFBLK,4,2                    ; @S_IFBLK
.subsections_via_symbols
