// File: /workspace/github_c_makefile_star2_O0/pipde[P]deos-songlib/lib/songlib.c
// Function: readSampleSet
static SAMPLE_SET *
readSampleSet(int inst,int baseNote)
    {
    SAMPLE_SET *ss = 0;
    char buffer[NOTE_NAME_LENGTH];

    /* try pitch octave name */

    sprintf(buffer, "%s%s%d",
        InstrumentBase[inst], NoteNames[baseNote % NOTES], baseNote / NOTES
        );
    
    ss = readSampleSetName(inst,baseNote,buffer);
    if (ss != 0) return ss;

    /* try Pitch octave name */

    sprintf(buffer, "%s%s%d",
        InstrumentBase[inst], NoteNAMES[baseNote % NOTES], baseNote / NOTES
        );
    
    ss = readSampleSetName(inst,baseNote,buffer);
    if (ss != 0) return ss;

    /* try baseNote name */

    sprintf(buffer, "%s%d",
        InstrumentBase[inst], baseNote
        );
    
    ss = readSampleSetName(inst,baseNote,buffer);
    if (ss != 0) return ss;

    /* try octave pitch name */

    sprintf(buffer, "%s%d%s",
        InstrumentBase[inst], baseNote / NOTES, NoteNames[baseNote % NOTES]
        );
    
    ss = readSampleSetName(inst,baseNote,buffer);
    if (ss != 0) return ss;

    /* try octave Pitch name */

    sprintf(buffer, "%s%d%s",
        InstrumentBase[inst], baseNote / NOTES, NoteNAMES[baseNote % NOTES]
        );
    
    ss = readSampleSetName(inst,baseNote,buffer);
    if (ss != 0) return ss;

    return 0;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x440, %rsp            # imm = 0x440
movl %edi, -0xc(%rbp)
movl %esi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
leaq -0x420(%rbp), %rdi
movslq -0xc(%rbp), %rcx
leaq 0x197e5(%rip), %rax     # 0x21e30
movq (%rax,%rcx,8), %rax
movq %rax, -0x428(%rbp)
movl -0x10(%rbp), %eax
movl $0xc, %ecx
cltd
idivl %ecx
movslq %edx, %rcx
leaq 0x9cb5(%rip), %rax      # 0x12320
movq (%rax,%rcx,8), %rcx
movl -0x10(%rbp), %eax
movl $0xc, %esi
cltd
idivl %esi
movq -0x428(%rbp), %rdx
movl %eax, %r8d
leaq 0x5050(%rip), %rsi      # 0xd6db
movb $0x0, %al
callq 0x2260
movl -0xc(%rbp), %edi
movl -0x10(%rbp), %esi
leaq -0x420(%rbp), %rdx
callq 0x88b0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x86bc
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x889d
leaq -0x420(%rbp), %rdi
movslq -0xc(%rbp), %rcx
leaq 0x19762(%rip), %rax     # 0x21e30
movq (%rax,%rcx,8), %rax
movq %rax, -0x430(%rbp)
movl -0x10(%rbp), %eax
movl $0xc, %ecx
cltd
idivl %ecx
movslq %edx, %rcx
leaq 0x9c92(%rip), %rax      # 0x12380
movq (%rax,%rcx,8), %rcx
movl -0x10(%rbp), %eax
movl $0xc, %esi
cltd
idivl %esi
movq -0x430(%rbp), %rdx
movl %eax, %r8d
leaq 0x4fcd(%rip), %rsi      # 0xd6db
movb $0x0, %al
callq 0x2260
movl -0xc(%rbp), %edi
movl -0x10(%rbp), %esi
leaq -0x420(%rbp), %rdx
callq 0x88b0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x873f
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x889d
leaq -0x420(%rbp), %rdi
movslq -0xc(%rbp), %rcx
leaq 0x196df(%rip), %rax     # 0x21e30
movq (%rax,%rcx,8), %rdx
movl -0x10(%rbp), %ecx
leaq 0x4f7e(%rip), %rsi      # 0xd6dd
movb $0x0, %al
callq 0x2260
movl -0xc(%rbp), %edi
movl -0x10(%rbp), %esi
leaq -0x420(%rbp), %rdx
callq 0x88b0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x8790
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x889d
leaq -0x420(%rbp), %rdi
movslq -0xc(%rbp), %rcx
leaq 0x1968e(%rip), %rax     # 0x21e30
movq (%rax,%rcx,8), %rax
movq %rax, -0x438(%rbp)
movl -0x10(%rbp), %eax
movl $0xc, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x10(%rbp), %eax
movl $0xc, %esi
cltd
idivl %esi
movl %edx, %eax
movq -0x438(%rbp), %rdx
movslq %eax, %rsi
leaq 0x9b48(%rip), %rax      # 0x12320
movq (%rax,%rsi,8), %r8
leaq 0x4eff(%rip), %rsi      # 0xd6e2
movb $0x0, %al
callq 0x2260
movl -0xc(%rbp), %edi
movl -0x10(%rbp), %esi
leaq -0x420(%rbp), %rdx
callq 0x88b0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x8814
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x889d
leaq -0x420(%rbp), %rdi
movslq -0xc(%rbp), %rcx
leaq 0x1960a(%rip), %rax     # 0x21e30
movq (%rax,%rcx,8), %rax
movq %rax, -0x440(%rbp)
movl -0x10(%rbp), %eax
movl $0xc, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x10(%rbp), %eax
movl $0xc, %esi
cltd
idivl %esi
movl %edx, %eax
movq -0x440(%rbp), %rdx
movslq %eax, %rsi
leaq 0x9b24(%rip), %rax      # 0x12380
movq (%rax,%rsi,8), %r8
leaq 0x4e7b(%rip), %rsi      # 0xd6e2
movb $0x0, %al
callq 0x2260
movl -0xc(%rbp), %edi
movl -0x10(%rbp), %esi
leaq -0x420(%rbp), %rdx
callq 0x88b0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x8895
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x889d
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x440, %rsp            # imm = 0x440
popq %rbp
retq
nopw (%rax,%rax)