// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_anim.c
// Function: lv_anim_path_bounce
lv_anim_value_t lv_anim_path_bounce(const lv_anim_t * a)
{
    /*Calculate the current step*/
    uint32_t t;
    if(a->time == a->act_time)
        t = 1024;
    else
        t = (uint32_t)((uint32_t)a->act_time * 1024) / a->time;

    int32_t diff = (a->end - a->start);

    /*3 bounces has 5 parts: 3 down and 2 up. One part is t / 5 long*/

    if(t < 408) {
        /*Go down*/
        t = (t * 2500) >> 10; /*[0..1024] range*/
    } else if(t >= 408 && t < 614) {
        /*First bounce back*/
        t -= 408;
        t    = t * 5; /*to [0..1024] range*/
        t    = 1024 - t;
        diff = diff / 6;
    } else if(t >= 614 && t < 819) {
        /*Fall back*/
        t -= 614;
        t    = t * 5; /*to [0..1024] range*/
        diff = diff / 6;
    } else if(t >= 819 && t < 921) {
        /*Second bounce back*/
        t -= 819;
        t    = t * 10; /*to [0..1024] range*/
        t    = 1024 - t;
        diff = diff / 16;
    } else if(t >= 921 && t <= 1024) {
        /*Fall back*/
        t -= 921;
        t    = t * 10; /*to [0..1024] range*/
        diff = diff / 16;
    }

    if(t > 1024) t = 1024;

    int32_t step = lv_bezier3(t, 1024, 1024, 800, 0);

    int32_t new_value;
    new_value = (int32_t)step * diff;
    new_value = new_value >> 10;
    new_value = a->end - new_value;

    return (lv_anim_value_t)new_value;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movzwl 0x28(%rax), %eax
movq -0x8(%rbp), %rcx
movswl 0x2a(%rcx), %ecx
cmpl %ecx, %eax
jne 0x44999
movl $0x400, -0xc(%rbp)      # imm = 0x400
jmp 0x449b3
movq -0x8(%rbp), %rax
movswl 0x2a(%rax), %eax
shll $0xa, %eax
movq -0x8(%rbp), %rcx
movzwl 0x28(%rcx), %ecx
xorl %edx, %edx
divl %ecx
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movl 0x24(%rax), %eax
movq -0x8(%rbp), %rcx
subl 0x20(%rcx), %eax
movl %eax, -0x10(%rbp)
cmpl $0x198, -0xc(%rbp)      # imm = 0x198
jae 0x449df
imull $0x9c4, -0xc(%rbp), %eax # imm = 0x9C4
shrl $0xa, %eax
movl %eax, -0xc(%rbp)
jmp 0x44ace
cmpl $0x198, -0xc(%rbp)      # imm = 0x198
jb 0x44a21
cmpl $0x266, -0xc(%rbp)      # imm = 0x266
jae 0x44a21
movl -0xc(%rbp), %eax
subl $0x198, %eax            # imm = 0x198
movl %eax, -0xc(%rbp)
imull $0x5, -0xc(%rbp), %eax
movl %eax, -0xc(%rbp)
movl $0x400, %eax            # imm = 0x400
subl -0xc(%rbp), %eax
movl %eax, -0xc(%rbp)
movl -0x10(%rbp), %eax
movl $0x6, %ecx
cltd
idivl %ecx
movl %eax, -0x10(%rbp)
jmp 0x44acc
cmpl $0x266, -0xc(%rbp)      # imm = 0x266
jb 0x44a55
cmpl $0x333, -0xc(%rbp)      # imm = 0x333
jae 0x44a55
movl -0xc(%rbp), %eax
subl $0x266, %eax            # imm = 0x266
movl %eax, -0xc(%rbp)
imull $0x5, -0xc(%rbp), %eax
movl %eax, -0xc(%rbp)
movl -0x10(%rbp), %eax
movl $0x6, %ecx
cltd
idivl %ecx
movl %eax, -0x10(%rbp)
jmp 0x44aca
cmpl $0x333, -0xc(%rbp)      # imm = 0x333
jb 0x44a94
cmpl $0x399, -0xc(%rbp)      # imm = 0x399
jae 0x44a94
movl -0xc(%rbp), %eax
subl $0x333, %eax            # imm = 0x333
movl %eax, -0xc(%rbp)
imull $0xa, -0xc(%rbp), %eax
movl %eax, -0xc(%rbp)
movl $0x400, %eax            # imm = 0x400
subl -0xc(%rbp), %eax
movl %eax, -0xc(%rbp)
movl -0x10(%rbp), %eax
movl $0x10, %ecx
cltd
idivl %ecx
movl %eax, -0x10(%rbp)
jmp 0x44ac8
cmpl $0x399, -0xc(%rbp)      # imm = 0x399
jb 0x44ac6
cmpl $0x400, -0xc(%rbp)      # imm = 0x400
ja 0x44ac6
movl -0xc(%rbp), %eax
subl $0x399, %eax            # imm = 0x399
movl %eax, -0xc(%rbp)
imull $0xa, -0xc(%rbp), %eax
movl %eax, -0xc(%rbp)
movl -0x10(%rbp), %eax
movl $0x10, %ecx
cltd
idivl %ecx
movl %eax, -0x10(%rbp)
jmp 0x44ac8
jmp 0x44aca
jmp 0x44acc
jmp 0x44ace
cmpl $0x400, -0xc(%rbp)      # imm = 0x400
jbe 0x44ade
movl $0x400, -0xc(%rbp)      # imm = 0x400
movl -0xc(%rbp), %edi
movl $0x400, %edx            # imm = 0x400
movl $0x320, %ecx            # imm = 0x320
xorl %r8d, %r8d
movl %edx, %esi
callq 0x47330
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
imull -0x10(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
sarl $0xa, %eax
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl 0x24(%rax), %eax
subl -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)