// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/teksnd.c
// Function: setupdigi
static void
setupdigi(void)
{
     int i;
     int32_t digilist[1024];

     fhsounds = kopen4load("sounds", 0);
     if( fhsounds < 0 ) {
          crashgame("setupdigi: cant open sounds");
     }
     memset(digilist, 0, sizeof(digilist));
     klseek(fhsounds, -sizeof(digilist), SEEK_END);
     i = kread(fhsounds, digilist, sizeof(digilist));
     if( i != sizeof(digilist) ) {
          crashgame("setupdigi: bad read of digilist");
     }

     memset(&sbuf, 0, sizeof(sbuf));
     for( i=0; i<TOTALSOUNDS; i++ ) {
          sbuf[i].offset=(digilist[i*3]*4096L);
          sbuf[i].cache_ptr=0L;
          sbuf[i].cache_length=digilist[i*3+1];
          sbuf[i].cache_lock=0x00;
     }
     for( i=0; i<MAXSOUNDS; i++ ) {
          dsound[i].handle=NULL_HANDLE;
          dsound[i].sndnum=0;
          dsound[i].plevel=0;
          dsound[i].x=0L;
          dsound[i].y=0L;
          dsound[i].type=ST_UPDATE;
          dsound[i].sndnum=-1;
     }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1010, %rsp           # imm = 0x1010
leaq 0xb391f(%rip), %rdi     # 0xda061
xorl %esi, %esi
callq 0x4d470
movl %eax, 0xf4621(%rip)     # 0x11ad70
cmpl $0x0, 0xf461a(%rip)     # 0x11ad70
jge 0x26766
leaq 0xb38ed(%rip), %rdi     # 0xda04c
movb $0x0, %al
callq 0x44240
leaq -0x1010(%rbp), %rdi
xorl %esi, %esi
movl $0x1000, %edx           # imm = 0x1000
callq 0x8410
movl 0xf45f1(%rip), %edi     # 0x11ad70
movl $0xfffff000, %esi       # imm = 0xFFFFF000
movl $0x2, %edx
callq 0x4db20
movl 0xf45dc(%rip), %edi     # 0x11ad70
leaq -0x1010(%rbp), %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0x4d840
movl %eax, -0x4(%rbp)
movslq -0x4(%rbp), %rax
cmpq $0x1000, %rax           # imm = 0x1000
je 0x267c2
leaq 0xb38ad(%rip), %rdi     # 0xda068
movb $0x0, %al
callq 0x44240
leaq 0x24bbe7(%rip), %rdi    # 0x2723b0
xorl %esi, %esi
movl $0x1380, %edx           # imm = 0x1380
callq 0x8410
movl $0x0, -0x4(%rbp)
cmpl $0xd0, -0x4(%rbp)
jge 0x26875
imull $0x3, -0x4(%rbp), %eax
cltq
movslq -0x1010(%rbp,%rax,4), %rax
shlq $0xc, %rax
movl %eax, %ecx
movslq -0x4(%rbp), %rdx
leaq 0x24bba8(%rip), %rax    # 0x2723b0
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x24bb93(%rip), %rax    # 0x2723b0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq $0x0, 0x8(%rax)
imull $0x3, -0x4(%rbp), %eax
addl $0x1, %eax
cltq
movl -0x1010(%rbp,%rax,4), %ecx
movslq -0x4(%rbp), %rdx
leaq 0x24bb69(%rip), %rax    # 0x2723b0
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x10(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x24bb54(%rip), %rax    # 0x2723b0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x14(%rax)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x267dc
movl $0x0, -0x4(%rbp)
cmpl $0x10, -0x4(%rbp)
jge 0x26941
movslq -0x4(%rbp), %rcx
leaq 0x24b99f(%rip), %rax    # 0x272230
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movslq -0x4(%rbp), %rcx
leaq 0x24b987(%rip), %rax    # 0x272230
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0x4(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x24b96e(%rip), %rax    # 0x272230
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0x8(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x24b955(%rip), %rax    # 0x272230
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0xc(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x24b93c(%rip), %rax    # 0x272230
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0x10(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x24b923(%rip), %rax    # 0x272230
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movw $0x2, 0x14(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x24b90b(%rip), %rax    # 0x272230
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl $0xffffffff, 0x4(%rax)  # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x2687c
addq $0x1010, %rsp           # imm = 0x1010
popq %rbp
retq
nopw (%rax,%rax)