// File: olegk0[P]readAVI/ReadAVI.cpp
// Function: ReadAVI::read_stream_header(ReadAVI::stream_header_t*)
int ReadAVI::read_stream_header(stream_header_t *sheader)
{
#ifdef VERBOSE
    long offset = inFile.tellg();
#endif
    read_chars(sheader->DataType, 4);
    read_chars(sheader->DataHandler, 4);
    sheader->Flags = read_int();
    sheader->Priority = read_int();
    sheader->InitialFrames = read_int();
    sheader->TimeScale = read_int();
    sheader->DataRate = read_int();
    sheader->StartTime = read_int();
    sheader->DataLength = read_int();
    sheader->SuggestedBufferSize = read_int();
    sheader->Quality = read_int();
    sheader->SampleSize = read_int();

    MSG_DBG(2, "            offset=0x%lx\n", offset);
    MSG_DBG(2, "                      DataType: %s\n", sheader->DataType);
    MSG_DBG(2, "                   DataHandler: ");
    print_data_handler((unsigned char *) sheader->DataHandler);
    MSG_DBG(2, "\n");
    MSG_DBG(2, "                         Flags: %d\n", sheader->Flags);
    MSG_DBG(2, "                      Priority: %d\n", sheader->Priority);
    MSG_DBG(2, "                 InitialFrames: %d\n", sheader->InitialFrames);
    MSG_DBG(2, "                     TimeScale: %d\n", sheader->TimeScale);
    MSG_DBG(2, "                      DataRate: %d\n", sheader->DataRate);
    MSG_DBG(2, "                     StartTime: %d\n", sheader->StartTime);
    MSG_DBG(2, "                    DataLength: %d\n", sheader->DataLength);
    MSG_DBG(2, "           SuggestedBufferSize: %d\n", sheader->SuggestedBufferSize);
    MSG_DBG(2, "                       Quality: %d\n", sheader->Quality);
    MSG_DBG(2, "                    SampleSize: %d\n", sheader->SampleSize);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x30(%rbp)
addq $0x20, %rdi
callq 0x23f0
movq %rax, -0x28(%rbp)
movq %rdx, -0x20(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5350
movq -0x30(%rbp), %rdi
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rsi
movl $0x4, %edx
callq 0x3f20
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x5, %rsi
movl $0x4, %edx
callq 0x3f20
movq -0x30(%rbp), %rdi
callq 0x3f60
movq -0x30(%rbp), %rdi
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xc(%rax)
callq 0x3f60
movq -0x30(%rbp), %rdi
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x10(%rax)
callq 0x3f60
movq -0x30(%rbp), %rdi
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x14(%rax)
callq 0x3f60
movq -0x30(%rbp), %rdi
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x18(%rax)
callq 0x3f60
movq -0x30(%rbp), %rdi
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x1c(%rax)
callq 0x3f60
movq -0x30(%rbp), %rdi
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x20(%rax)
callq 0x3f60
movq -0x30(%rbp), %rdi
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x24(%rax)
callq 0x3f60
movq -0x30(%rbp), %rdi
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x28(%rax)
callq 0x3f60
movq -0x30(%rbp), %rdi
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x2c(%rax)
callq 0x3f60
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x30(%rax)
movq 0x4bc7(%rip), %rax      # 0x8fb0
movq (%rax), %rdi
movq -0x18(%rbp), %rdx
leaq 0x203d(%rip), %rsi      # 0x6434
movb $0x0, %al
callq 0x2360
movq 0x4bab(%rip), %rax      # 0x8fb0
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x203b(%rip), %rsi      # 0x644e
movb $0x0, %al
callq 0x2360
movq 0x4b8f(%rip), %rax      # 0x8fb0
movq (%rax), %rdi
leaq 0x2047(%rip), %rsi      # 0x6472
movb $0x0, %al
callq 0x2360
movq -0x10(%rbp), %rdi
addq $0x5, %rdi
callq 0x45a0
movq 0x4b6a(%rip), %rax      # 0x8fb0
movq (%rax), %rdi
leaq 0x252e(%rip), %rsi      # 0x697e
movb $0x0, %al
callq 0x2360
movq 0x4b52(%rip), %rax      # 0x8fb0
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl 0xc(%rax), %edx
leaq 0x1e39(%rip), %rsi      # 0x62a8
movb $0x0, %al
callq 0x2360
movq 0x4b33(%rip), %rax      # 0x8fb0
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x10(%rax), %edx
leaq 0x2005(%rip), %rsi      # 0x6493
movb $0x0, %al
callq 0x2360
movq 0x4b14(%rip), %rax      # 0x8fb0
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x14(%rax), %edx
leaq 0x200a(%rip), %rsi      # 0x64b7
movb $0x0, %al
callq 0x2360
movq 0x4af5(%rip), %rax      # 0x8fb0
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x18(%rax), %edx
leaq 0x1ed8(%rip), %rsi      # 0x63a4
movb $0x0, %al
callq 0x2360
movq 0x4ad6(%rip), %rax      # 0x8fb0
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %edx
leaq 0x1edd(%rip), %rsi      # 0x63c8
movb $0x0, %al
callq 0x2360
movq 0x4ab7(%rip), %rax      # 0x8fb0
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x20(%rax), %edx
leaq 0x1ee2(%rip), %rsi      # 0x63ec
movb $0x0, %al
callq 0x2360
movq 0x4a98(%rip), %rax      # 0x8fb0
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x24(%rax), %edx
leaq 0x1ee7(%rip), %rsi      # 0x6410
movb $0x0, %al
callq 0x2360
movq 0x4a79(%rip), %rax      # 0x8fb0
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x28(%rax), %edx
leaq 0x1df0(%rip), %rsi      # 0x6338
movb $0x0, %al
callq 0x2360
movq 0x4a5a(%rip), %rax      # 0x8fb0
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x2c(%rax), %edx
leaq 0x1f74(%rip), %rsi      # 0x64db
movb $0x0, %al
callq 0x2360
movq 0x4a3b(%rip), %rax      # 0x8fb0
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x30(%rax), %edx
leaq 0x1f79(%rip), %rsi      # 0x64ff
movb $0x0, %al
callq 0x2360
xorl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)