// File: drummyfish[P]flowchart/src/bitmap_image.hpp
// Function: bitmap_image::read_bih(std::basic_ifstream<char, std::char_traits<char>>&, bitmap_image::bitmap_information_header&)
inline void read_bih(std::ifstream& stream,bitmap_information_header& bih)
   {
      read_from_stream(stream,bih.size);
      read_from_stream(stream,bih.width);
      read_from_stream(stream,bih.height);
      read_from_stream(stream,bih.planes);
      read_from_stream(stream,bih.bit_count);
      read_from_stream(stream,bih.compression);
      read_from_stream(stream,bih.size_image);
      read_from_stream(stream,bih.x_pels_per_meter);
      read_from_stream(stream,bih.y_pels_per_meter);
      read_from_stream(stream,bih.clr_used);
      read_from_stream(stream,bih.clr_important);

      if (big_endian())
      {
         bih.size = flip(bih.size);
         bih.width = flip(bih.width);
         bih.height = flip(bih.height);
         bih.planes = flip(bih.planes);
         bih.bit_count = flip(bih.bit_count);
         bih.compression = flip(bih.compression);
         bih.size_image = flip(bih.size_image);
         bih.x_pels_per_meter = flip(bih.x_pels_per_meter);
         bih.y_pels_per_meter = flip(bih.y_pels_per_meter);
         bih.clr_used = flip(bih.clr_used);
         bih.clr_important = flip(bih.clr_important);
      }
   }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x16e20
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
addq $0x4, %rdx
callq 0x16e20
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
addq $0x8, %rdx
callq 0x16e20
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
addq $0xc, %rdx
callq 0x16df0
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
addq $0xe, %rdx
callq 0x16df0
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
addq $0x10, %rdx
callq 0x16e20
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
addq $0x14, %rdx
callq 0x16e20
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
addq $0x18, %rdx
callq 0x16e20
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
addq $0x1c, %rdx
callq 0x16e20
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
addq $0x20, %rdx
callq 0x16e20
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
addq $0x24, %rdx
callq 0x16e20
movq -0x20(%rbp), %rdi
callq 0x16e50
testb $0x1, %al
jne 0x16c2d
jmp 0x16d4a
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x16eb0
movq -0x20(%rbp), %rdi
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rsi
addq $0x4, %rsi
callq 0x16eb0
movq -0x20(%rbp), %rdi
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x18(%rbp), %rsi
addq $0x8, %rsi
callq 0x16eb0
movq -0x20(%rbp), %rdi
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x18(%rbp), %rsi
addq $0xc, %rsi
callq 0x16e80
movq -0x20(%rbp), %rdi
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, 0xc(%rax)
movq -0x18(%rbp), %rsi
addq $0xe, %rsi
callq 0x16e80
movq -0x20(%rbp), %rdi
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, 0xe(%rax)
movq -0x18(%rbp), %rsi
addq $0x10, %rsi
callq 0x16eb0
movq -0x20(%rbp), %rdi
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x18(%rbp), %rsi
addq $0x14, %rsi
callq 0x16eb0
movq -0x20(%rbp), %rdi
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x18(%rbp), %rsi
addq $0x18, %rsi
callq 0x16eb0
movq -0x20(%rbp), %rdi
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x18(%rbp), %rsi
addq $0x1c, %rsi
callq 0x16eb0
movq -0x20(%rbp), %rdi
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x1c(%rax)
movq -0x18(%rbp), %rsi
addq $0x20, %rsi
callq 0x16eb0
movq -0x20(%rbp), %rdi
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x18(%rbp), %rsi
addq $0x24, %rsi
callq 0x16eb0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x24(%rax)
addq $0x20, %rsp
popq %rbp
retq