// File: /workspace/github_c_makefile_star2_O0/pipde[P]deos-songlib/utils/zero/zero.c
// Function: adjustCurrent
static void
adjustCurrent(int amt)
    {
    int i,delta;

    //adjust current value down

    //printf("adjusting current index %d\n",Spot);

    Window[Spot%SIZE2] = 0;
    
    /* adjust the previous values */
    i = 1;
    delta = (int)(amt * Factor);
    while (abs(delta) > 0)
        {
        //printf("delta is %d\n",delta);
        if (i >= SIZE) break;
        if (Spot-i < 0) break;
        if (Window[(Spot-i+SIZE2)%SIZE2] == 0) break;
        //printf("changing index %d (%d) from %d ",
        //    Spot-i,(Spot-i+SIZE2)%SIZE2,
        //    Window[(Spot-i+SIZE2)%SIZE2]);
        Window[(Spot-i+SIZE2)%SIZE2] -= delta;
        if (Window[(Spot-i+SIZE2)%SIZE2] == 0)
            Window[(Spot-i+SIZE2)%SIZE2] = -1;
        //printf("to %d\n",Window[(Spot-i+SIZE2)%SIZE2]);
        ++i;
        delta = (int)(delta * Factor);
        }

    /* adjust the future values */
    i = 1;
    delta = (int)(amt * Factor);
    while (abs(delta) > 0)
        {
        //printf("delta is %d\n",delta);
        if (i >= SIZE) break;
        if (Window[(Spot+i)%SIZE2] == 0) break;
        //printf("changing index %d (%d) from %d ",
        //    Spot+i,(Spot+i)%SIZE2,
        //    Window[(Spot+i)%SIZE2]);
        Window[(Spot+i)%SIZE2] -= delta;
        if (Window[(Spot+i)%SIZE2] == 0)
            Window[(Spot+i)%SIZE2] = -1;
        //printf("to %d\n",Window[(Spot+i)%SIZE2]);
        ++i;
        delta = (int)(delta * Factor);
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl 0x663f(%rip), %eax      # 0x812c
movl $0x15, %ecx
cltd
idivl %ecx
movslq %edx, %rcx
leaq 0x6661(%rip), %rax      # 0x8160
movl $0x0, (%rax,%rcx,4)
movl $0x1, -0x8(%rbp)
cvtsi2sdl -0x4(%rbp), %xmm0
mulsd 0x661e(%rip), %xmm0     # 0x8138
cvttsd2si %xmm0, %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
cmpl $0x0, %eax
jle 0x1c1c
cmpl $0xa, -0x8(%rbp)
jl 0x1b3f
jmp 0x1c1c
movl 0x65e7(%rip), %eax      # 0x812c
subl -0x8(%rbp), %eax
cmpl $0x0, %eax
jge 0x1b52
jmp 0x1c1c
movl 0x65d4(%rip), %eax      # 0x812c
subl -0x8(%rbp), %eax
addl $0x15, %eax
movl $0x15, %ecx
cltd
idivl %ecx
movslq %edx, %rcx
leaq 0x65f0(%rip), %rax      # 0x8160
cmpl $0x0, (%rax,%rcx,4)
jne 0x1b7b
jmp 0x1c1c
movl -0xc(%rbp), %eax
movl %eax, -0x10(%rbp)
movl 0x65a5(%rip), %eax      # 0x812c
subl -0x8(%rbp), %eax
addl $0x15, %eax
movl $0x15, %ecx
cltd
idivl %ecx
movl -0x10(%rbp), %eax
movslq %edx, %rcx
leaq 0x65be(%rip), %rdx      # 0x8160
movl (%rdx,%rcx,4), %edx
subl %eax, %edx
leaq 0x65b2(%rip), %rax      # 0x8160
movl %edx, (%rax,%rcx,4)
movl 0x6575(%rip), %eax      # 0x812c
subl -0x8(%rbp), %eax
addl $0x15, %eax
movl $0x15, %ecx
cltd
idivl %ecx
movslq %edx, %rcx
leaq 0x6591(%rip), %rax      # 0x8160
cmpl $0x0, (%rax,%rcx,4)
jne 0x1bfa
movl 0x6551(%rip), %eax      # 0x812c
subl -0x8(%rbp), %eax
addl $0x15, %eax
movl $0x15, %ecx
cltd
idivl %ecx
movslq %edx, %rcx
leaq 0x656d(%rip), %rax      # 0x8160
movl $0xffffffff, (%rax,%rcx,4) # imm = 0xFFFFFFFF
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
cvtsi2sdl -0xc(%rbp), %xmm0
mulsd 0x6528(%rip), %xmm0     # 0x8138
cvttsd2si %xmm0, %eax
movl %eax, -0xc(%rbp)
jmp 0x1b21
movl $0x1, -0x8(%rbp)
cvtsi2sdl -0x4(%rbp), %xmm0
mulsd 0x6508(%rip), %xmm0     # 0x8138
cvttsd2si %xmm0, %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
cmpl $0x0, %eax
jle 0x1d13
cmpl $0xa, -0x8(%rbp)
jl 0x1c55
jmp 0x1d13
movl 0x64d1(%rip), %eax      # 0x812c
addl -0x8(%rbp), %eax
movl $0x15, %ecx
cltd
idivl %ecx
movslq %edx, %rcx
leaq 0x64f0(%rip), %rax      # 0x8160
cmpl $0x0, (%rax,%rcx,4)
jne 0x1c7b
jmp 0x1d13
movl -0xc(%rbp), %eax
movl %eax, -0x14(%rbp)
movl 0x64a5(%rip), %eax      # 0x812c
addl -0x8(%rbp), %eax
movl $0x15, %ecx
cltd
idivl %ecx
movl -0x14(%rbp), %eax
movslq %edx, %rcx
leaq 0x64c1(%rip), %rdx      # 0x8160
movl (%rdx,%rcx,4), %edx
subl %eax, %edx
leaq 0x64b5(%rip), %rax      # 0x8160
movl %edx, (%rax,%rcx,4)
movl 0x6478(%rip), %eax      # 0x812c
addl -0x8(%rbp), %eax
movl $0x15, %ecx
cltd
idivl %ecx
movslq %edx, %rcx
leaq 0x6497(%rip), %rax      # 0x8160
cmpl $0x0, (%rax,%rcx,4)
jne 0x1cf1
movl 0x6457(%rip), %eax      # 0x812c
addl -0x8(%rbp), %eax
movl $0x15, %ecx
cltd
idivl %ecx
movslq %edx, %rcx
leaq 0x6476(%rip), %rax      # 0x8160
movl $0xffffffff, (%rax,%rcx,4) # imm = 0xFFFFFFFF
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
cvtsi2sdl -0xc(%rbp), %xmm0
mulsd 0x6431(%rip), %xmm0     # 0x8138
cvttsd2si %xmm0, %eax
movl %eax, -0xc(%rbp)
jmp 0x1c37
popq %rbp
retq
nopw %cs:(%rax,%rax)