// File: lvandeve[P]lodepng/lodepng_unittest.cpp
// Function: doTestHuffmanCodeLengths(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned long)
void doTestHuffmanCodeLengths(const std::string& expectedstr, const std::string& counts, size_t bitlength) {
  std::vector<unsigned> expected = strtovector(expectedstr);
  std::vector<unsigned> count = strtovector(counts);
  std::cout << "doTestHuffmanCodeLengths: " << counts << std::endl;
  std::vector<unsigned> result(count.size());
  unsigned error = lodepng_huffman_code_lengths(&result[0], &count[0], count.size(), bitlength);
  ASSERT_NO_PNG_ERROR_MSG(error, "errorcode");
  std::stringstream ss1, ss2;
  for(size_t i = 0; i < count.size(); i++) {
    ss1 << expected[i] << " ";
    ss2 << result[i] << " ";
  }
  assertEquals(ss1.str(), ss2.str(), "value");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x590, %rsp            # imm = 0x590
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x38440
movq -0x10(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x38440
jmp 0x385d3
movq 0xbf9fe(%rip), %rdi     # 0xf7fd8
leaq 0x7b634(%rip), %rsi     # 0xb3c15
callq 0x3230
movq %rax, -0x4e0(%rbp)
jmp 0x385ef
movq -0x4e0(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x3200
movq %rax, -0x4e8(%rbp)
jmp 0x38608
movq -0x4e8(%rbp), %rdi
movq 0xbf9aa(%rip), %rsi     # 0xf7fc0
callq 0x3280
jmp 0x3861d
leaq -0x48(%rbp), %rdi
callq 0xaad10
movq %rax, -0x4f0(%rbp)
jmp 0x3862f
movl $0x0, -0x74(%rbp)
leaq -0x75(%rbp), %rdi
movq %rdi, -0x4f8(%rbp)
callq 0xaad30
movq -0x4f0(%rbp), %rsi
movq -0x4f8(%rbp), %rcx
leaq -0x70(%rbp), %rdi
leaq -0x74(%rbp), %rdx
callq 0xaad50
jmp 0x38663
leaq -0x75(%rbp), %rdi
callq 0xaadd0
xorl %eax, %eax
movl %eax, %esi
leaq -0x70(%rbp), %rdi
callq 0xaadf0
movq %rax, -0x500(%rbp)
jmp 0x38682
xorl %eax, %eax
movl %eax, %esi
leaq -0x48(%rbp), %rdi
callq 0xaadf0
movq %rax, -0x508(%rbp)
jmp 0x38698
leaq -0x48(%rbp), %rdi
callq 0xaad10
movq %rax, -0x510(%rbp)
jmp 0x386aa
movq -0x510(%rbp), %rdx
movq -0x508(%rbp), %rsi
movq -0x500(%rbp), %rdi
movl -0x18(%rbp), %ecx
callq 0x3840
movl %eax, -0x514(%rbp)
jmp 0x386cf
movl -0x514(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
movl %eax, -0x524(%rbp)
leaq -0xe1(%rbp), %rdi
movq %rdi, -0x520(%rbp)
callq 0x3440
movq -0x520(%rbp), %rdx
leaq 0x7aa13(%rip), %rsi     # 0xb3115
leaq -0xe0(%rbp), %rdi
callq 0x3340
jmp 0x38710
leaq 0x7b519(%rip), %rdx     # 0xb3c30
leaq -0xc0(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0xaa1b0
jmp 0x3872c
leaq -0x129(%rbp), %rdi
movq %rdi, -0x530(%rbp)
callq 0x3440
movq -0x530(%rbp), %rdx
movb $0x0, -0x12b(%rbp)
movb $0x0, -0x152(%rbp)
movb $0x0, -0x153(%rbp)
leaq 0x7b4d3(%rip), %rsi     # 0xb3c35
leaq -0x128(%rbp), %rdi
callq 0x3340
jmp 0x38770
leaq -0x128(%rbp), %rdi
callq 0x33f0
movb %al, -0x531(%rbp)
jmp 0x38784
movb -0x531(%rbp), %al
testb $0x1, %al
jne 0x38790
jmp 0x387c8
leaq -0x12a(%rbp), %rdi
movq %rdi, -0x540(%rbp)
callq 0x3440
movq -0x540(%rbp), %rdx
movb $0x1, -0x12b(%rbp)
leaq 0x7bd4c(%rip), %rsi     # 0xb4504
leaq -0x108(%rbp), %rdi
callq 0x3340
jmp 0x387c6
jmp 0x38823
leaq -0x151(%rbp), %rdi
movq %rdi, -0x548(%rbp)
callq 0x3440
movq -0x548(%rbp), %rdx
movb $0x1, -0x152(%rbp)
leaq 0x7b445(%rip), %rsi     # 0xb3c35
leaq -0x150(%rbp), %rdi
callq 0x3340
jmp 0x387fe
movb $0x1, -0x153(%rbp)
leaq 0x7ded7(%rip), %rsi     # 0xb66e3
leaq -0x108(%rbp), %rdi
leaq -0x150(%rbp), %rdx
callq 0xaa6d0
jmp 0x38821
jmp 0x38823
leaq -0xa0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
leaq -0x108(%rbp), %rdx
callq 0xaa240
jmp 0x3883f
movl -0x524(%rbp), %edi
leaq -0xa0(%rbp), %rsi
callq 0x28d30
jmp 0x38853
leaq -0xa0(%rbp), %rdi
callq 0x34a8
jmp 0x38861
leaq -0x108(%rbp), %rdi
callq 0x34a8
jmp 0x3886f
testb $0x1, -0x153(%rbp)
jne 0x3887a
jmp 0x3888a
leaq -0x150(%rbp), %rdi
callq 0x34a8
jmp 0x38888
jmp 0x3888a
testb $0x1, -0x152(%rbp)
jne 0x38895
jmp 0x388a1
leaq -0x151(%rbp), %rdi
callq 0x3290
testb $0x1, -0x12b(%rbp)
jne 0x388ac
jmp 0x388b8
leaq -0x12a(%rbp), %rdi
callq 0x3290
leaq -0x128(%rbp), %rdi
callq 0x34a8
jmp 0x388c6
leaq -0x129(%rbp), %rdi
callq 0x3290
leaq -0xc0(%rbp), %rdi
callq 0x34a8
jmp 0x388e0
leaq -0xe0(%rbp), %rdi
callq 0x34a8
jmp 0x388ee
leaq -0xe1(%rbp), %rdi
callq 0x3290
leaq -0x2e0(%rbp), %rdi
callq 0x31a0
jmp 0x38908
leaq -0x468(%rbp), %rdi
callq 0x31a0
jmp 0x38916
movq $0x0, -0x470(%rbp)
movq -0x470(%rbp), %rax
movq %rax, -0x558(%rbp)
leaq -0x48(%rbp), %rdi
callq 0xaad10
movq %rax, -0x550(%rbp)
jmp 0x38941
movq -0x558(%rbp), %rax
movq -0x550(%rbp), %rcx
cmpq %rcx, %rax
jae 0x38bdb
leaq -0x2d0(%rbp), %rax
movq %rax, -0x568(%rbp)
movq -0x470(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0xaadf0
movq %rax, -0x560(%rbp)
jmp 0x3897f
movq -0x568(%rbp), %rdi
movq -0x560(%rbp), %rax
movl (%rax), %esi
callq 0x3310
movq %rax, -0x570(%rbp)
jmp 0x3899d
movq -0x570(%rbp), %rdi
leaq 0x7bb58(%rip), %rsi     # 0xb4503
callq 0x3230
jmp 0x389b2
leaq -0x458(%rbp), %rax
movq %rax, -0x580(%rbp)
movq -0x470(%rbp), %rsi
leaq -0x70(%rbp), %rdi
callq 0xaadf0
movq %rax, -0x578(%rbp)
jmp 0x389d9
movq -0x580(%rbp), %rdi
movq -0x578(%rbp), %rax
movl (%rax), %esi
callq 0x3310
movq %rax, -0x588(%rbp)
jmp 0x389f7
movq -0x588(%rbp), %rdi
leaq 0x7bafe(%rip), %rsi     # 0xb4503
callq 0x3230
jmp 0x38a0c
jmp 0x38a0e
movq -0x470(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x470(%rbp)
jmp 0x38921
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x38d68
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x38d5b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x75(%rbp), %rdi
callq 0xaadd0
jmp 0x38d5b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x38d4e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x38ba8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x38b98
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x38b7c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x38b6c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x38b53
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x38b3a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x38b1d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x38b0d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x34a8
jmp 0x38b0b
jmp 0x38b0d
leaq -0x108(%rbp), %rdi
callq 0x34a8
jmp 0x38b1b
jmp 0x38b1d
testb $0x1, -0x153(%rbp)
jne 0x38b28
jmp 0x38b38
leaq -0x150(%rbp), %rdi
callq 0x34a8
jmp 0x38b36
jmp 0x38b38
jmp 0x38b3a
testb $0x1, -0x152(%rbp)
jne 0x38b45
jmp 0x38b51
leaq -0x151(%rbp), %rdi
callq 0x3290
jmp 0x38b53
testb $0x1, -0x12b(%rbp)
jne 0x38b5e
jmp 0x38b6a
leaq -0x12a(%rbp), %rdi
callq 0x3290
jmp 0x38b6c
leaq -0x128(%rbp), %rdi
callq 0x34a8
jmp 0x38b7a
jmp 0x38b7c
leaq -0x129(%rbp), %rdi
callq 0x3290
leaq -0xc0(%rbp), %rdi
callq 0x34a8
jmp 0x38b96
jmp 0x38b98
leaq -0xe0(%rbp), %rdi
callq 0x34a8
jmp 0x38ba6
jmp 0x38ba8
leaq -0xe1(%rbp), %rdi
callq 0x3290
jmp 0x38d4e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x38d3e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x38d2e
leaq -0x490(%rbp), %rdi
leaq -0x2e0(%rbp), %rsi
callq 0x3220
jmp 0x38bf0
leaq -0x4b0(%rbp), %rdi
leaq -0x468(%rbp), %rsi
callq 0x3220
jmp 0x38c05
leaq -0x4d1(%rbp), %rdi
movq %rdi, -0x590(%rbp)
callq 0x3440
movq -0x590(%rbp), %rdx
leaq 0x7b019(%rip), %rsi     # 0xb3c3f
leaq -0x4d0(%rbp), %rdi
callq 0x3340
jmp 0x38c34
leaq -0x490(%rbp), %rdi
leaq -0x4b0(%rbp), %rsi
leaq -0x4d0(%rbp), %rdx
callq 0xaae10
jmp 0x38c50
leaq -0x4d0(%rbp), %rdi
callq 0x34a8
jmp 0x38c5e
leaq -0x4d1(%rbp), %rdi
callq 0x3290
leaq -0x4b0(%rbp), %rdi
callq 0x34a8
jmp 0x38c78
leaq -0x490(%rbp), %rdi
callq 0x34a8
jmp 0x38c86
leaq -0x468(%rbp), %rdi
callq 0x31b0
jmp 0x38c94
leaq -0x2e0(%rbp), %rdi
callq 0x31b0
jmp 0x38ca2
leaq -0x70(%rbp), %rdi
callq 0xaac90
jmp 0x38cad
leaq -0x48(%rbp), %rdi
callq 0xaac90
jmp 0x38cb8
leaq -0x30(%rbp), %rdi
callq 0xaac90
addq $0x590, %rsp            # imm = 0x590
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x38d1e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x38d02
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x4d0(%rbp), %rdi
callq 0x34a8
jmp 0x38d00
jmp 0x38d02
leaq -0x4d1(%rbp), %rdi
callq 0x3290
leaq -0x4b0(%rbp), %rdi
callq 0x34a8
jmp 0x38d1c
jmp 0x38d1e
leaq -0x490(%rbp), %rdi
callq 0x34a8
jmp 0x38d2c
jmp 0x38d2e
leaq -0x468(%rbp), %rdi
callq 0x31b0
jmp 0x38d3c
jmp 0x38d3e
leaq -0x2e0(%rbp), %rdi
callq 0x31b0
jmp 0x38d4c
jmp 0x38d4e
leaq -0x70(%rbp), %rdi
callq 0xaac90
jmp 0x38d59
jmp 0x38d5b
leaq -0x48(%rbp), %rdi
callq 0xaac90
jmp 0x38d66
jmp 0x38d68
leaq -0x30(%rbp), %rdi
callq 0xaac90
jmp 0x38d73
jmp 0x38d75
movq -0x50(%rbp), %rdi
callq 0x3430
movq %rax, %rdi
callq 0x1a490
nopw %cs:(%rax,%rax)