	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_calculate_reserved         ## -- Begin function ubi_calculate_reserved
	.p2align	4, 0x90
_ubi_calculate_reserved:                ## @ubi_calculate_reserved
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movslq	4(%rdi), %rax
	imulq	$1374389535, %rax, %rax         ## imm = 0x51EB851F
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$37, %rax
	addl	%ecx, %eax
	movl	%eax, (%rdi)
	movq	_CONFIG_MTD_UBI_BEB_RESERVE@GOTPCREL(%rip), %rcx
	imull	(%rcx), %eax
	movl	%eax, (%rdi)
	movq	_MIN_RESEVED_PEBS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	%ecx, %eax
	cmovlel	%ecx, %eax
	movl	%eax, (%rdi)
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CONFIG_MTD_UBI_BEB_RESERVE,4,2 ## @CONFIG_MTD_UBI_BEB_RESERVE
	.comm	_MIN_RESEVED_PEBS,4,2           ## @MIN_RESEVED_PEBS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_calculate_reserved         ; -- Begin function ubi_calculate_reserved
	.p2align	2
_ubi_calculate_reserved:                ; @ubi_calculate_reserved
	.cfi_startproc
; %bb.0:
	ldrsw	x8, [x0, #4]
	mov	w9, #34079
	movk	w9, #20971, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	asr	x8, x8, #37
	add	w8, w8, w9
	str	w8, [x0]
Lloh0:
	adrp	x9, _CONFIG_MTD_UBI_BEB_RESERVE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CONFIG_MTD_UBI_BEB_RESERVE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	mul	w8, w9, w8
	str	w8, [x0]
Lloh3:
	adrp	x9, _MIN_RESEVED_PEBS@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MIN_RESEVED_PEBS@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	csel	w8, w8, w9, gt
	str	w8, [x0]
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_CONFIG_MTD_UBI_BEB_RESERVE,4,2 ; @CONFIG_MTD_UBI_BEB_RESERVE
	.comm	_MIN_RESEVED_PEBS,4,2           ; @MIN_RESEVED_PEBS
.subsections_via_symbols
