	.file	"extr_sm501fb.c_sm501fb_check_var.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	sm501fb_check_var, @function
sm501fb_check_var:
.LFB0:
	.cfi_startproc
	endbr64
	cmp	DWORD PTR [rdi], 255
	jg	.L25
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	rbx, rdi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	cmp	DWORD PTR 4[rdi], 63
	jg	.L23
	mov	eax, DWORD PTR 12[rdi]
	add	eax, DWORD PTR 8[rdi]
	cmp	eax, 4096
	jg	.L23
	mov	eax, DWORD PTR 20[rdi]
	add	eax, DWORD PTR 16[rdi]
	cmp	eax, 2048
	jle	.L29
.L23:
	mov	eax, DWORD PTR EINVAL[rip]
	neg	eax
.L1:
	add	rsp, 8
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L25:
	.cfi_restore 3
	.cfi_restore 6
	mov	eax, DWORD PTR EINVAL[rip]
	neg	eax
	ret
	.p2align 4,,10
	.p2align 3
.L29:
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -24
	.cfi_offset 6, -16
	mov	rax, QWORD PTR [rsi]
	mov	rbp, QWORD PTR [rax]
	call	h_total@PLT
	cmp	eax, 4096
	jg	.L23
	mov	rdi, rbx
	call	v_total@PLT
	cmp	eax, 2048
	jg	.L23
	mov	ecx, DWORD PTR 24[rbx]
	mov	edx, DWORD PTR 8[rbx]
	imul	edx, ecx
	test	edx, edx
	lea	eax, 7[rdx]
	cmovns	eax, edx
	sar	eax, 3
	and	eax, 15
	jne	.L23
	cmp	DWORD PTR 28[rbx], 4096
	jg	.L23
	cmp	DWORD PTR 32[rbx], 2048
	jg	.L23
	cmp	ecx, 8
	jg	.L9
	mov	DWORD PTR 24[rbx], 8
	mov	QWORD PTR 36[rbx], 0
	mov	QWORD PTR 44[rbx], 8
	mov	QWORD PTR 52[rbx], 8
	mov	QWORD PTR 60[rbx], 8
	jmp	.L1
.L9:
	cmp	ecx, 16
	jg	.L10
	mov	rdx, QWORD PTR 0[rbp]
	mov	DWORD PTR 24[rbx], 16
	mov	edx, DWORD PTR [rdx]
	test	DWORD PTR SM501_FBPD_SWAP_FB_ENDIAN[rip], edx
	je	.L30
	mov	DWORD PTR 48[rbx], 11
	mov	DWORD PTR 56[rbx], 5
	mov	DWORD PTR 64[rbx], 0
.L16:
	mov	DWORD PTR 60[rbx], 5
	mov	DWORD PTR 52[rbx], 6
	mov	QWORD PTR 36[rbx], 0
	mov	DWORD PTR 44[rbx], 5
	jmp	.L1
.L10:
	cmp	ecx, 24
	je	.L31
	cmp	ecx, 32
	jne	.L23
.L14:
	mov	rdx, QWORD PTR 0[rbp]
	mov	edx, DWORD PTR [rdx]
	test	DWORD PTR SM501_FBPD_SWAP_FB_ENDIAN[rip], edx
	je	.L17
	mov	DWORD PTR 36[rbx], 0
	mov	DWORD PTR 64[rbx], 8
	mov	DWORD PTR 56[rbx], 16
	mov	DWORD PTR 48[rbx], 24
.L18:
	movabs	rcx, 34359738368
	mov	DWORD PTR 60[rbx], 8
	mov	DWORD PTR 52[rbx], 8
	mov	QWORD PTR 40[rbx], rcx
	jmp	.L1
.L30:
	mov	DWORD PTR 64[rbx], 11
	mov	DWORD PTR 56[rbx], 5
	mov	DWORD PTR 48[rbx], 0
	jmp	.L16
.L17:
	mov	DWORD PTR 36[rbx], 24
	mov	DWORD PTR 64[rbx], 16
	mov	DWORD PTR 56[rbx], 8
	mov	DWORD PTR 48[rbx], 0
	jmp	.L18
.L31:
	mov	DWORD PTR 24[rbx], 32
	jmp	.L14
	.cfi_endproc
.LFE0:
	.size	sm501fb_check_var, .-sm501fb_check_var
	.comm	SM501_FBPD_SWAP_FB_ENDIAN,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_sm501fb.c_sm501fb_check_var.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	sm501fb_check_var, %function
sm501fb_check_var:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, [r0]
	cmp	r3, #255
	bgt	.L25
	ldr	r3, [r0, #4]
	push	{r4, r5, r6, lr}
	cmp	r3, #63
	mov	r4, r0
	bgt	.L23
	ldr	r3, [r0, #8]
	ldr	r2, [r0, #12]
	add	r3, r3, r2
	cmp	r3, #4096
	bgt	.L23
	ldr	r3, [r0, #16]
	ldr	r2, [r0, #20]
	add	r3, r3, r2
	cmp	r3, #2048
	ble	.L29
.L23:
	ldr	r3, .L31
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r4, r5, r6, pc}
.L25:
	ldr	r3, .L31
	ldr	r0, [r3]
	rsb	r0, r0, #0
	bx	lr
.L29:
	ldr	r3, [r1]
	ldr	r5, [r3]
	bl	h_total
	cmp	r0, #4096
	bgt	.L23
	mov	r0, r4
	bl	v_total
	cmp	r0, #2048
	bgt	.L23
	ldr	r2, [r4, #24]
	ldr	r3, [r4, #8]
	mul	r3, r2, r3
	cmp	r3, #0
	add	r1, r3, #7
	movlt	r3, r1
	tst	r3, #120
	bne	.L23
	ldr	r3, [r4, #28]
	cmp	r3, #4096
	bgt	.L23
	ldr	r3, [r4, #32]
	cmp	r3, #2048
	bgt	.L23
	cmp	r2, #8
	bgt	.L9
	mov	r0, #0
	mov	r3, #8
	str	r0, [r4, #64]
	str	r3, [r4, #24]
	str	r3, [r4, #60]
	str	r3, [r4, #52]
	str	r3, [r4, #44]
	str	r0, [r4, #56]
	str	r0, [r4, #48]
	str	r0, [r4, #40]
	str	r0, [r4, #36]
	pop	{r4, r5, r6, pc}
.L9:
	cmp	r2, #16
	bgt	.L10
	mov	r1, #16
	ldr	r3, [r5]
	ldr	r2, .L31+4
	ldr	r3, [r3]
	ldr	r2, [r2]
	str	r1, [r4, #24]
	ands	r3, r3, r2
	beq	.L30
	mov	r1, #11
	mov	r2, #5
	mov	r3, #0
	str	r1, [r4, #48]
	str	r2, [r4, #56]
	str	r3, [r4, #64]
.L16:
	mov	r0, #0
	mov	r3, #5
	mov	r2, #6
	str	r0, [r4, #36]
	str	r0, [r4, #40]
	str	r3, [r4, #60]
	str	r3, [r4, #44]
	str	r2, [r4, #52]
	pop	{r4, r5, r6, pc}
.L10:
	cmp	r2, #24
	moveq	r3, #32
	streq	r3, [r4, #24]
	beq	.L14
	cmp	r2, #32
	bne	.L23
.L14:
	ldr	r3, [r5]
	ldr	r2, .L31+4
	ldr	r3, [r3]
	ldr	r2, [r2]
	ands	r3, r3, r2
	beq	.L17
	mov	r0, #0
	mov	r1, #8
	mov	r2, #16
	mov	r3, #24
	str	r0, [r4, #36]
	str	r1, [r4, #64]
	str	r2, [r4, #56]
	str	r3, [r4, #48]
.L18:
	mov	r3, #8
	mov	r0, #0
	str	r3, [r4, #60]
	str	r3, [r4, #52]
	str	r3, [r4, #44]
	str	r0, [r4, #40]
	pop	{r4, r5, r6, pc}
.L30:
	mov	r1, #11
	mov	r2, #5
	str	r3, [r4, #48]
	str	r1, [r4, #64]
	str	r2, [r4, #56]
	b	.L16
.L17:
	mov	r0, #24
	mov	r1, #16
	mov	r2, #8
	str	r3, [r4, #48]
	str	r0, [r4, #36]
	str	r1, [r4, #64]
	str	r2, [r4, #56]
	b	.L18
.L32:
	.align	2
.L31:
	.word	EINVAL
	.word	SM501_FBPD_SWAP_FB_ENDIAN
	.size	sm501fb_check_var, .-sm501fb_check_var
	.comm	SM501_FBPD_SWAP_FB_ENDIAN,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
