// File: /workspace/github_c_makefile_star2_O0/pipde[P]deos-songlib/lib/songlib.c
// Function: ddraw
void
ddraw(double beats,int inst1,int inst2,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,inst1,i,octaves,pitches,lengths);

    backwards(beats);

    softer(2);
    play(length,inst2,octave,pitch);

    /* extract the remaining arguments */

    va_start(ap, length);

    octave = va_arg(ap,int);
    while (octave != (int) 0)
        {
        pitch = va_arg(ap,int);
        length = va_arg(ap,double);

        play(length,inst2,octave,pitch);
        octave = va_arg(ap,int);
        }

    va_end(ap);

    louder(2);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x21d0, %rsp           # imm = 0x21D0
testb %al, %al
je 0x4b59
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)
movsd %xmm0, -0x8(%rbp)
movl %edi, -0xc(%rbp)
movl %esi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movsd %xmm1, -0x20(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x830(%rbp)
movl -0x18(%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 $0x20, (%rax)
leaq -0x2050(%rbp), %rax
movq %rax, -0x2110(%rbp)
movl -0x2050(%rbp), %eax
movl %eax, -0x2104(%rbp)
cmpl $0x28, %eax
ja 0x4c04
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 0x4c21
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, -0x14(%rbp)
movl $0x1, -0x24(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x14(%rbp)
movb %al, -0x2119(%rbp)
je 0x4c55
movslq -0x24(%rbp), %rax
cmpq $0x200, %rax            # imm = 0x200
setb %al
movb %al, -0x2119(%rbp)
movb -0x2119(%rbp), %al
testb $0x1, %al
jne 0x4c64
jmp 0x4df6
leaq -0x2050(%rbp), %rax
movq %rax, -0x2128(%rbp)
movl -0x2050(%rbp), %eax
movl %eax, -0x2120(%rbp)
cmpl $0x28, %eax
ja 0x4ca5
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 0x4cc2
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, -0x18(%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 0x4d23
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 0x4d40
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 -0x14(%rbp), %ecx
movslq -0x24(%rbp), %rax
movl %ecx, -0x830(%rbp,%rax,4)
movl -0x18(%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 0x4dc8
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 0x4de5
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, -0x14(%rbp)
jmp 0x4c34
leaq -0x2050(%rbp), %rax
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
movsd -0x8(%rbp), %xmm0
callq 0x3870
movsd 0x84fc(%rip), %xmm0     # 0xd330
callq 0x5080
movq 0xd5d8(%rip), %rax      # 0x12418
movsd -0x20(%rbp), %xmm0
movl -0x10(%rbp), %edi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
callq *%rax
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 $0x20, (%rax)
leaq -0x2050(%rbp), %rax
movq %rax, -0x2178(%rbp)
movl -0x2050(%rbp), %eax
movl %eax, -0x216c(%rbp)
cmpl $0x28, %eax
ja 0x4eb8
movq -0x2178(%rbp), %rcx
movl -0x216c(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x2180(%rbp)
jmp 0x4ed5
movq -0x2178(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x2180(%rbp)
movq -0x2180(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x505d
leaq -0x2050(%rbp), %rax
movq %rax, -0x2190(%rbp)
movl -0x2050(%rbp), %eax
movl %eax, -0x2184(%rbp)
cmpl $0x28, %eax
ja 0x4f2c
movq -0x2190(%rbp), %rcx
movl -0x2184(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x2198(%rbp)
jmp 0x4f49
movq -0x2190(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x2198(%rbp)
movq -0x2198(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x18(%rbp)
leaq -0x2050(%rbp), %rax
movq %rax, -0x21b0(%rbp)
addq $0x4, %rax
movq %rax, -0x21a8(%rbp)
movl -0x204c(%rbp), %eax
movl %eax, -0x219c(%rbp)
cmpl $0xa0, %eax
ja 0x4faa
movq -0x21a8(%rbp), %rcx
movl -0x219c(%rbp), %edx
movq -0x21b0(%rbp), %rsi
movslq %edx, %rax
addq 0x10(%rsi), %rax
addl $0x10, %edx
movl %edx, (%rcx)
movq %rax, -0x21b8(%rbp)
jmp 0x4fc7
movq -0x21b0(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x21b8(%rbp)
movq -0x21b8(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x20(%rbp)
movq 0xd43a(%rip), %rax      # 0x12418
movsd -0x20(%rbp), %xmm0
movl -0x10(%rbp), %edi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
callq *%rax
leaq -0x2050(%rbp), %rax
movq %rax, -0x21c8(%rbp)
movl -0x2050(%rbp), %eax
movl %eax, -0x21bc(%rbp)
cmpl $0x28, %eax
ja 0x502f
movq -0x21c8(%rbp), %rcx
movl -0x21bc(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x21d0(%rbp)
jmp 0x504c
movq -0x21c8(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x21d0(%rbp)
movq -0x21d0(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
jmp 0x4ee1
movsd 0x82cb(%rip), %xmm0     # 0xd330
callq 0x50f0
addq $0x21d0, %rsp           # imm = 0x21D0
popq %rbp
retq
nopw %cs:(%rax,%rax)