	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function otp_select_filemode
_otp_select_filemode:                   ## @otp_select_filemode
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %rdi
	cmpl	$128, %esi
	je	LBB0_6
## %bb.1:
	cmpl	$129, %esi
	je	LBB0_8
## %bb.2:
	cmpl	$130, %esi
	jne	LBB0_9
## %bb.3:
	leaq	-16(%rbp), %rcx
	movl	$-1, %esi
	xorl	%edx, %edx
	xorl	%r8d, %r8d
	callq	_mtd_read_fact_prot_reg
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rcx
	movl	%eax, %edx
	addl	(%rcx), %edx
	je	LBB0_10
## %bb.4:
	movq	_MTD_FILE_MODE_OTP_FACTORY@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_6:
	leaq	-16(%rbp), %rcx
	movl	$-1, %esi
	xorl	%edx, %edx
	xorl	%r8d, %r8d
	callq	_mtd_read_user_prot_reg
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rcx
	movl	%eax, %edx
	addl	(%rcx), %edx
	je	LBB0_10
## %bb.7:
	movq	_MTD_FILE_MODE_OTP_USER@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_8:
	movq	_MTD_FILE_MODE_NORMAL@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	xorl	%eax, %eax
	jmp	LBB0_10
LBB0_9:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_MTD_FILE_MODE_OTP_FACTORY,4,2  ## @MTD_FILE_MODE_OTP_FACTORY
	.comm	_MTD_FILE_MODE_OTP_USER,4,2     ## @MTD_FILE_MODE_OTP_USER
	.comm	_MTD_FILE_MODE_NORMAL,4,2       ## @MTD_FILE_MODE_NORMAL
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_otp_select_filemode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function otp_select_filemode
_otp_select_filemode:                   ; @otp_select_filemode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
	ldr	x0, [x0, #8]
	cmp	w1, #128
	b.eq	LBB0_5
; %bb.1:
	cmp	w1, #129
	b.eq	LBB0_7
; %bb.2:
	cmp	w1, #130
	b.ne	LBB0_9
; %bb.3:
	add	x3, sp, #8
	mov	w1, #-1
	mov	w2, #0
	mov	x4, #0
	bl	_mtd_read_fact_prot_reg
Lloh0:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmn	w0, w8
	b.eq	LBB0_10
; %bb.4:
	mov	w0, #0
Lloh3:
	adrp	x8, _MTD_FILE_MODE_OTP_FACTORY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MTD_FILE_MODE_OTP_FACTORY@GOTPAGEOFF]
	b	LBB0_8
LBB0_5:
	add	x3, sp, #8
	mov	w1, #-1
	mov	w2, #0
	mov	x4, #0
	bl	_mtd_read_user_prot_reg
Lloh5:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmn	w0, w8
	b.eq	LBB0_10
; %bb.6:
	mov	w0, #0
Lloh8:
	adrp	x8, _MTD_FILE_MODE_OTP_USER@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MTD_FILE_MODE_OTP_USER@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
	mov	w0, #0
Lloh10:
	adrp	x8, _MTD_FILE_MODE_NORMAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _MTD_FILE_MODE_NORMAL@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	str	w8, [x19]
	b	LBB0_10
LBB0_9:
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_MTD_FILE_MODE_OTP_FACTORY,4,2  ; @MTD_FILE_MODE_OTP_FACTORY
	.comm	_MTD_FILE_MODE_OTP_USER,4,2     ; @MTD_FILE_MODE_OTP_USER
	.comm	_MTD_FILE_MODE_NORMAL,4,2       ; @MTD_FILE_MODE_NORMAL
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_otp_select_filemode
.subsections_via_symbols
