// File: /workspace/github_c_makefile_star2_O0/pipde[P]deos-songlib/lib/songlib.c
// Function: draw
void
draw(double beats,int inst,int octave,int pitch,double length,...)
    {
    int i;
    int octaves[CHORD_LENGTH],pitches[CHORD_LENGTH];
    double lengths[CHORD_LENGTH];

    dTrace("entering\n");;

    octaves[0] = octave;
    pitches[0] = pitch;
    lengths[0] = length;

    /* extract the remaining arguments */

    va_list ap;

    va_start(ap, length);

    octave = va_arg(ap,int);
    i = 1;
    while (octave != (int) 0 && i < sizeof(octaves)/sizeof(int))
        {
        pitch = va_arg(ap,int);
        length = va_arg(ap,double);

        octaves[i] = octave;
        pitches[i] = pitch;
        lengths[i] = length;

        ++i;

        octave = va_arg(ap,int);
        }

    va_end(ap);

    adraw(beats,inst,i,octaves,pitches,lengths);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2170, %rsp           # imm = 0x2170
testb %al, %al
je 0x5199
movaps %xmm2, -0x20b0(%rbp)
movaps %xmm3, -0x20a0(%rbp)
movaps %xmm4, -0x2090(%rbp)
movaps %xmm5, -0x2080(%rbp)
movaps %xmm6, -0x2070(%rbp)
movaps %xmm7, -0x2060(%rbp)
movq %r9, -0x20d8(%rbp)
movq %r8, -0x20e0(%rbp)
movq %rcx, -0x20e8(%rbp)
movsd %xmm0, -0x8(%rbp)
movl %edi, -0xc(%rbp)
movl %esi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movsd %xmm1, -0x20(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x830(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x1030(%rbp)
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x2030(%rbp)
leaq -0x2050(%rbp), %rax
leaq -0x2100(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x50, 0x4(%rax)
movl $0x18, (%rax)
leaq -0x2050(%rbp), %rax
movq %rax, -0x2110(%rbp)
movl -0x2050(%rbp), %eax
movl %eax, -0x2104(%rbp)
cmpl $0x28, %eax
ja 0x5248
movq -0x2110(%rbp), %rcx
movl -0x2104(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x2118(%rbp)
jmp 0x5265
movq -0x2110(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x2118(%rbp)
movq -0x2118(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x10(%rbp)
movl $0x1, -0x24(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x10(%rbp)
movb %al, -0x2119(%rbp)
je 0x5299
movslq -0x24(%rbp), %rax
cmpq $0x200, %rax            # imm = 0x200
setb %al
movb %al, -0x2119(%rbp)
movb -0x2119(%rbp), %al
testb $0x1, %al
jne 0x52a8
jmp 0x543a
leaq -0x2050(%rbp), %rax
movq %rax, -0x2128(%rbp)
movl -0x2050(%rbp), %eax
movl %eax, -0x2120(%rbp)
cmpl $0x28, %eax
ja 0x52e9
movq -0x2128(%rbp), %rcx
movl -0x2120(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x2130(%rbp)
jmp 0x5306
movq -0x2128(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x2130(%rbp)
movq -0x2130(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
leaq -0x2050(%rbp), %rax
movq %rax, -0x2148(%rbp)
addq $0x4, %rax
movq %rax, -0x2140(%rbp)
movl -0x204c(%rbp), %eax
movl %eax, -0x2134(%rbp)
cmpl $0xa0, %eax
ja 0x5367
movq -0x2140(%rbp), %rcx
movl -0x2134(%rbp), %edx
movq -0x2148(%rbp), %rsi
movslq %edx, %rax
addq 0x10(%rsi), %rax
addl $0x10, %edx
movl %edx, (%rcx)
movq %rax, -0x2150(%rbp)
jmp 0x5384
movq -0x2148(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x2150(%rbp)
movq -0x2150(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x20(%rbp)
movl -0x10(%rbp), %ecx
movslq -0x24(%rbp), %rax
movl %ecx, -0x830(%rbp,%rax,4)
movl -0x14(%rbp), %ecx
movslq -0x24(%rbp), %rax
movl %ecx, -0x1030(%rbp,%rax,4)
movsd -0x20(%rbp), %xmm0
movslq -0x24(%rbp), %rax
movsd %xmm0, -0x2030(%rbp,%rax,8)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
leaq -0x2050(%rbp), %rax
movq %rax, -0x2160(%rbp)
movl -0x2050(%rbp), %eax
movl %eax, -0x2154(%rbp)
cmpl $0x28, %eax
ja 0x540c
movq -0x2160(%rbp), %rcx
movl -0x2154(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x2168(%rbp)
jmp 0x5429
movq -0x2160(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x2168(%rbp)
movq -0x2168(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x10(%rbp)
jmp 0x5278
movsd -0x8(%rbp), %xmm0
movl -0xc(%rbp), %edi
movl -0x24(%rbp), %esi
leaq -0x830(%rbp), %rdx
leaq -0x1030(%rbp), %rcx
leaq -0x2030(%rbp), %r8
callq 0x45e0
addq $0x2170, %rsp           # imm = 0x2170
popq %rbp
retq
nopl (%rax,%rax)