// File: adrianphoulady[P]weighted-tsetlin-machine-cpp/./weightm.h
// Function: weightm::weightm(std::istream&)
explicit weightm(std::istream &is)
    : features{get<int>(is)},
      clauses{get<int>(is)},
      p{get<double>(is)},
      gamma{get<double>(is)},
      threshold{get<int>(is)},
      states{get<int>(is)},
      literals{(2 * features - 1) / word_bits + 1},
      actmask{~((bool) (2 * features % word_bits) * ~((word) 0) << 2 * features % word_bits)},
      state{clauses, literals, states},
      lmask{literals},
      clause{clauses},
      weight{clauses} {
        mcg_state = get<uint64_t>(is);
        for (int c = 0; c < clauses; ++c)
            for (int l = 0; l < literals; ++l)
                for (int b = 0; b < states; ++b)
                    state(c, l, b) = get<word>(is);
        for (int c = 0; c < clauses; ++c)
            weight(c) = get<double>(is);
    }

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x78(%rsp), %rdi
callq 0x4b20
movl %eax, %ecx
movq 0x48(%rsp), %rax
movl %ecx, (%rax)
movq 0x78(%rsp), %rdi
callq 0x4b20
movl %eax, %ecx
movq 0x48(%rsp), %rax
movl %ecx, 0x4(%rax)
movq 0x78(%rsp), %rdi
callq 0x4ee0
movq 0x48(%rsp), %rax
movsd %xmm0, 0x8(%rax)
movq 0x78(%rsp), %rdi
callq 0x4ee0
movq 0x48(%rsp), %rax
movsd %xmm0, 0x10(%rax)
movq 0x78(%rsp), %rdi
callq 0x4b20
movl %eax, %ecx
movq 0x48(%rsp), %rax
movl %ecx, 0x18(%rax)
movq 0x78(%rsp), %rdi
callq 0x4b20
movl %eax, %ecx
movq 0x48(%rsp), %rax
movl %ecx, 0x1c(%rax)
movl (%rax), %ecx
movl %ecx, %edx
leal -0x1(%rdx,%rdx), %ecx
leal 0x1e(%rdx,%rdx), %edx
testl %ecx, %ecx
cmovsl %edx, %ecx
sarl $0x5, %ecx
incl %ecx
movl %ecx, 0x20(%rax)
movl (%rax), %esi
movl %esi, %ecx
addl %ecx, %ecx
movl %esi, %edx
leal 0x1f(%rdx,%rdx), %esi
testl %ecx, %ecx
movl %ecx, %edx
cmovsl %esi, %edx
andl $-0x20, %edx
subl %edx, %ecx
xorl %edx, %edx
movl %ecx, %esi
negl %esi
sbbl %edx, %edx
shll %cl, %edx
movl %edx, %ecx
notl %ecx
movl %ecx, 0x24(%rax)
movq %rax, %rdi
addq $0x28, %rdi
movq %rdi, 0x40(%rsp)
movl 0x20(%rax), %edx
movl 0x4(%rax), %esi
movl 0x1c(%rax), %ecx
callq 0x4f10
movq 0x48(%rsp), %rax
movq %rax, %rdi
addq $0x40, %rdi
movq %rdi, 0x50(%rsp)
movl 0x20(%rax), %esi
callq 0x4f70
jmp 0x4cbf
movq 0x48(%rsp), %rax
movq %rax, %rdi
addq $0x50, %rdi
movq %rdi, 0x38(%rsp)
movl 0x4(%rax), %esi
callq 0x40f0
jmp 0x4cda
movq 0x48(%rsp), %rax
movq %rax, %rdi
addq $0x60, %rdi
movq %rdi, 0x30(%rsp)
movl 0x4(%rax), %esi
callq 0x4fb0
jmp 0x4cf5
movq 0x78(%rsp), %rdi
callq 0x4ff0
movq %rax, 0x28(%rsp)
jmp 0x4d06
movq 0x28(%rsp), %rax
movq %rax, 0x74de(%rip)      # 0xc1f0
movl $0x0, 0x68(%rsp)
movq 0x48(%rsp), %rcx
movl 0x68(%rsp), %eax
cmpl 0x4(%rcx), %eax
jge 0x4e23
movl $0x0, 0x64(%rsp)
movq 0x48(%rsp), %rcx
movl 0x64(%rsp), %eax
cmpl 0x20(%rcx), %eax
jge 0x4e11
movl $0x0, 0x60(%rsp)
movq 0x48(%rsp), %rcx
movl 0x60(%rsp), %eax
cmpl 0x1c(%rcx), %eax
jge 0x4dff
movq 0x78(%rsp), %rdi
callq 0x5020
movl %eax, 0x24(%rsp)
jmp 0x4d70
movq 0x48(%rsp), %rdi
addq $0x28, %rdi
movl 0x68(%rsp), %esi
movl 0x64(%rsp), %edx
movl 0x60(%rsp), %ecx
callq 0x5050
movq %rax, 0x18(%rsp)
jmp 0x4d91
movq 0x18(%rsp), %rax
movl 0x24(%rsp), %ecx
movl %ecx, (%rax)
movl 0x60(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x60(%rsp)
jmp 0x4d4e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
jmp 0x4e9c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
jmp 0x4e92
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
jmp 0x4e88
movq 0x30(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x70(%rsp)
movl %eax, 0x6c(%rsp)
callq 0x50b0
jmp 0x4e88
jmp 0x4e01
movl 0x64(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x64(%rsp)
jmp 0x4d34
jmp 0x4e13
movl 0x68(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x68(%rsp)
jmp 0x4d1a
movl $0x0, 0x5c(%rsp)
movq 0x48(%rsp), %rcx
movl 0x5c(%rsp), %eax
cmpl 0x4(%rcx), %eax
jge 0x4e80
movq 0x78(%rsp), %rdi
callq 0x4ee0
movsd %xmm0, 0x10(%rsp)
jmp 0x4e4b
movq 0x48(%rsp), %rdi
addq $0x60, %rdi
movl 0x5c(%rsp), %esi
callq 0x5090
movq %rax, 0x8(%rsp)
jmp 0x4e64
movq 0x8(%rsp), %rax
movsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rax)
movl 0x5c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5c(%rsp)
jmp 0x4e2b
addq $0x88, %rsp
retq
movq 0x38(%rsp), %rdi
callq 0x4520
movq 0x50(%rsp), %rdi
callq 0x50e0
movq 0x40(%rsp), %rdi
callq 0x5110
movq 0x70(%rsp), %rdi
callq 0x2360