// File: /workspace/github_c_makefile_star2_O0/FastFilter[P]BlockBloomSimulator/src/bitset.c
// Function: bitset_union_count
size_t bitset_union_count(const bitset_t *restrict b1, const bitset_t * restrict b2) {
  size_t answer = 0;
  size_t minlength = b1->arraysize < b2->arraysize ? b1->arraysize : b2->arraysize;
  size_t k = 0;
  for( ; k + 3 < minlength; k += 4) {
    answer += __builtin_popcountll ( b1->array[k] | b2->array[k]);
    answer += __builtin_popcountll ( b1->array[k+1] | b2->array[k+1]);
    answer += __builtin_popcountll ( b1->array[k+2] | b2->array[k+2]);
    answer += __builtin_popcountll ( b1->array[k+3] | b2->array[k+3]);
  }
  for( ; k < minlength; ++k) {
    answer += __builtin_popcountll ( b1->array[k] | b2->array[k]);
  }
  if(b2->arraysize > b1->arraysize) {
    //k = b1->arraysize;
    for(; k + 3 < b2->arraysize; k+=4) {
      answer += __builtin_popcountll (b2->array[k]);
      answer += __builtin_popcountll (b2->array[k+1]);
      answer += __builtin_popcountll (b2->array[k+2]);
      answer += __builtin_popcountll (b2->array[k+3]);
    }
    for(; k < b2->arraysize; ++k) {
      answer += __builtin_popcountll (b2->array[k]);
    }
  } else {
    //k = b2->arraysize;
    for(; k  + 3 < b1->arraysize; k+=4) {
      answer += __builtin_popcountll (b1->array[k]);
      answer += __builtin_popcountll (b1->array[k+1]);
      answer += __builtin_popcountll (b1->array[k+2]);
      answer += __builtin_popcountll (b1->array[k+3]);
    }
    for(; k < b1->arraysize; ++k) {
      answer += __builtin_popcountll (b1->array[k]);
    }
  }
  return answer;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq $0x0, -0x18(%rsp)
movq -0x8(%rsp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x4447
movq -0x8(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rsp)
jmp 0x4455
movq -0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rsp)
movq -0x30(%rsp), %rax
movq %rax, -0x20(%rsp)
movq $0x0, -0x28(%rsp)
movq -0x28(%rsp), %rax
addq $0x3, %rax
cmpq -0x20(%rsp), %rax
jae 0x46b1
movq -0x8(%rsp), %rax
movq (%rax), %rax
movq -0x28(%rsp), %rcx
movq (%rax,%rcx,8), %rcx
movq -0x10(%rsp), %rax
movq (%rax), %rax
movq -0x28(%rsp), %rdx
orq (%rax,%rdx,8), %rcx
movq %rcx, %rax
shrq %rax
movabsq $0x5555555555555555, %rdx # imm = 0x5555555555555555
andq %rdx, %rax
subq %rax, %rcx
movabsq $0x3333333333333333, %rdx # imm = 0x3333333333333333
movq %rcx, %rax
andq %rdx, %rax
shrq $0x2, %rcx
andq %rdx, %rcx
addq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
addq %rcx, %rax
movabsq $0xf0f0f0f0f0f0f0f, %rcx # imm = 0xF0F0F0F0F0F0F0F
andq %rcx, %rax
movabsq $0x101010101010101, %rcx # imm = 0x101010101010101
imulq %rcx, %rax
shrq $0x38, %rax
cltq
addq -0x18(%rsp), %rax
movq %rax, -0x18(%rsp)
movq -0x8(%rsp), %rax
movq (%rax), %rax
movq -0x28(%rsp), %rcx
movq 0x8(%rax,%rcx,8), %rcx
movq -0x10(%rsp), %rax
movq (%rax), %rax
movq -0x28(%rsp), %rdx
orq 0x8(%rax,%rdx,8), %rcx
movq %rcx, %rax
shrq %rax
movabsq $0x5555555555555555, %rdx # imm = 0x5555555555555555
andq %rdx, %rax
subq %rax, %rcx
movabsq $0x3333333333333333, %rdx # imm = 0x3333333333333333
movq %rcx, %rax
andq %rdx, %rax
shrq $0x2, %rcx
andq %rdx, %rcx
addq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
addq %rcx, %rax
movabsq $0xf0f0f0f0f0f0f0f, %rcx # imm = 0xF0F0F0F0F0F0F0F
andq %rcx, %rax
movabsq $0x101010101010101, %rcx # imm = 0x101010101010101
imulq %rcx, %rax
shrq $0x38, %rax
cltq
addq -0x18(%rsp), %rax
movq %rax, -0x18(%rsp)
movq -0x8(%rsp), %rax
movq (%rax), %rax
movq -0x28(%rsp), %rcx
movq 0x10(%rax,%rcx,8), %rcx
movq -0x10(%rsp), %rax
movq (%rax), %rax
movq -0x28(%rsp), %rdx
orq 0x10(%rax,%rdx,8), %rcx
movq %rcx, %rax
shrq %rax
movabsq $0x5555555555555555, %rdx # imm = 0x5555555555555555
andq %rdx, %rax
subq %rax, %rcx
movabsq $0x3333333333333333, %rdx # imm = 0x3333333333333333
movq %rcx, %rax
andq %rdx, %rax
shrq $0x2, %rcx
andq %rdx, %rcx
addq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
addq %rcx, %rax
movabsq $0xf0f0f0f0f0f0f0f, %rcx # imm = 0xF0F0F0F0F0F0F0F
andq %rcx, %rax
movabsq $0x101010101010101, %rcx # imm = 0x101010101010101
imulq %rcx, %rax
shrq $0x38, %rax
cltq
addq -0x18(%rsp), %rax
movq %rax, -0x18(%rsp)
movq -0x8(%rsp), %rax
movq (%rax), %rax
movq -0x28(%rsp), %rcx
movq 0x18(%rax,%rcx,8), %rcx
movq -0x10(%rsp), %rax
movq (%rax), %rax
movq -0x28(%rsp), %rdx
orq 0x18(%rax,%rdx,8), %rcx
movq %rcx, %rax
shrq %rax
movabsq $0x5555555555555555, %rdx # imm = 0x5555555555555555
andq %rdx, %rax
subq %rax, %rcx
movabsq $0x3333333333333333, %rdx # imm = 0x3333333333333333
movq %rcx, %rax
andq %rdx, %rax
shrq $0x2, %rcx
andq %rdx, %rcx
addq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
addq %rcx, %rax
movabsq $0xf0f0f0f0f0f0f0f, %rcx # imm = 0xF0F0F0F0F0F0F0F
andq %rcx, %rax
movabsq $0x101010101010101, %rcx # imm = 0x101010101010101
imulq %rcx, %rax
shrq $0x38, %rax
cltq
addq -0x18(%rsp), %rax
movq %rax, -0x18(%rsp)
movq -0x28(%rsp), %rax
addq $0x4, %rax
movq %rax, -0x28(%rsp)
jmp 0x4468
jmp 0x46b3
movq -0x28(%rsp), %rax
cmpq -0x20(%rsp), %rax
jae 0x475d
movq -0x8(%rsp), %rax
movq (%rax), %rax
movq -0x28(%rsp), %rcx
movq (%rax,%rcx,8), %rcx
movq -0x10(%rsp), %rax
movq (%rax), %rax
movq -0x28(%rsp), %rdx
orq (%rax,%rdx,8), %rcx
movq %rcx, %rax
shrq %rax
movabsq $0x5555555555555555, %rdx # imm = 0x5555555555555555
andq %rdx, %rax
subq %rax, %rcx
movabsq $0x3333333333333333, %rdx # imm = 0x3333333333333333
movq %rcx, %rax
andq %rdx, %rax
shrq $0x2, %rcx
andq %rdx, %rcx
addq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
addq %rcx, %rax
movabsq $0xf0f0f0f0f0f0f0f, %rcx # imm = 0xF0F0F0F0F0F0F0F
andq %rcx, %rax
movabsq $0x101010101010101, %rcx # imm = 0x101010101010101
imulq %rcx, %rax
shrq $0x38, %rax
cltq
addq -0x18(%rsp), %rax
movq %rax, -0x18(%rsp)
movq -0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rsp)
jmp 0x46b3
movq -0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jbe 0x4a21
jmp 0x4777
movq -0x28(%rsp), %rax
addq $0x3, %rax
movq -0x10(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x497d
movq -0x10(%rsp), %rax
movq (%rax), %rax
movq -0x28(%rsp), %rcx
movq (%rax,%rcx,8), %rcx
movq %rcx, %rax
shrq %rax
movabsq $0x5555555555555555, %rdx # imm = 0x5555555555555555
andq %rdx, %rax
subq %rax, %rcx
movabsq $0x3333333333333333, %rdx # imm = 0x3333333333333333
movq %rcx, %rax
andq %rdx, %rax
shrq $0x2, %rcx
andq %rdx, %rcx
addq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
addq %rcx, %rax
movabsq $0xf0f0f0f0f0f0f0f, %rcx # imm = 0xF0F0F0F0F0F0F0F
andq %rcx, %rax
movabsq $0x101010101010101, %rcx # imm = 0x101010101010101
imulq %rcx, %rax
shrq $0x38, %rax
cltq
addq -0x18(%rsp), %rax
movq %rax, -0x18(%rsp)
movq -0x10(%rsp), %rax
movq (%rax), %rax
movq -0x28(%rsp), %rcx
movq 0x8(%rax,%rcx,8), %rcx
movq %rcx, %rax
shrq %rax
movabsq $0x5555555555555555, %rdx # imm = 0x5555555555555555
andq %rdx, %rax
subq %rax, %rcx
movabsq $0x3333333333333333, %rdx # imm = 0x3333333333333333
movq %rcx, %rax
andq %rdx, %rax
shrq $0x2, %rcx
andq %rdx, %rcx
addq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
addq %rcx, %rax
movabsq $0xf0f0f0f0f0f0f0f, %rcx # imm = 0xF0F0F0F0F0F0F0F
andq %rcx, %rax
movabsq $0x101010101010101, %rcx # imm = 0x101010101010101
imulq %rcx, %rax
shrq $0x38, %rax
cltq
addq -0x18(%rsp), %rax
movq %rax, -0x18(%rsp)
movq -0x10(%rsp), %rax
movq (%rax), %rax
movq -0x28(%rsp), %rcx
movq 0x10(%rax,%rcx,8), %rcx
movq %rcx, %rax
shrq %rax
movabsq $0x5555555555555555, %rdx # imm = 0x5555555555555555
andq %rdx, %rax
subq %rax, %rcx
movabsq $0x3333333333333333, %rdx # imm = 0x3333333333333333
movq %rcx, %rax
andq %rdx, %rax
shrq $0x2, %rcx
andq %rdx, %rcx
addq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
addq %rcx, %rax
movabsq $0xf0f0f0f0f0f0f0f, %rcx # imm = 0xF0F0F0F0F0F0F0F
andq %rcx, %rax
movabsq $0x101010101010101, %rcx # imm = 0x101010101010101
imulq %rcx, %rax
shrq $0x38, %rax
cltq
addq -0x18(%rsp), %rax
movq %rax, -0x18(%rsp)
movq -0x10(%rsp), %rax
movq (%rax), %rax
movq -0x28(%rsp), %rcx
movq 0x18(%rax,%rcx,8), %rcx
movq %rcx, %rax
shrq %rax
movabsq $0x5555555555555555, %rdx # imm = 0x5555555555555555
andq %rdx, %rax
subq %rax, %rcx
movabsq $0x3333333333333333, %rdx # imm = 0x3333333333333333
movq %rcx, %rax
andq %rdx, %rax
shrq $0x2, %rcx
andq %rdx, %rcx
addq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
addq %rcx, %rax
movabsq $0xf0f0f0f0f0f0f0f, %rcx # imm = 0xF0F0F0F0F0F0F0F
andq %rcx, %rax
movabsq $0x101010101010101, %rcx # imm = 0x101010101010101
imulq %rcx, %rax
shrq $0x38, %rax
cltq
addq -0x18(%rsp), %rax
movq %rax, -0x18(%rsp)
movq -0x28(%rsp), %rax
addq $0x4, %rax
movq %rax, -0x28(%rsp)
jmp 0x4777
jmp 0x497f
movq -0x28(%rsp), %rax
movq -0x10(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x4a1c
movq -0x10(%rsp), %rax
movq (%rax), %rax
movq -0x28(%rsp), %rcx
movq (%rax,%rcx,8), %rcx
movq %rcx, %rax
shrq %rax
movabsq $0x5555555555555555, %rdx # imm = 0x5555555555555555
andq %rdx, %rax
subq %rax, %rcx
movabsq $0x3333333333333333, %rdx # imm = 0x3333333333333333
movq %rcx, %rax
andq %rdx, %rax
shrq $0x2, %rcx
andq %rdx, %rcx
addq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
addq %rcx, %rax
movabsq $0xf0f0f0f0f0f0f0f, %rcx # imm = 0xF0F0F0F0F0F0F0F
andq %rcx, %rax
movabsq $0x101010101010101, %rcx # imm = 0x101010101010101
imulq %rcx, %rax
shrq $0x38, %rax
cltq
addq -0x18(%rsp), %rax
movq %rax, -0x18(%rsp)
movq -0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rsp)
jmp 0x497f
jmp 0x4cca
jmp 0x4a23
movq -0x28(%rsp), %rax
addq $0x3, %rax
movq -0x8(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x4c29
movq -0x8(%rsp), %rax
movq (%rax), %rax
movq -0x28(%rsp), %rcx
movq (%rax,%rcx,8), %rcx
movq %rcx, %rax
shrq %rax
movabsq $0x5555555555555555, %rdx # imm = 0x5555555555555555
andq %rdx, %rax
subq %rax, %rcx
movabsq $0x3333333333333333, %rdx # imm = 0x3333333333333333
movq %rcx, %rax
andq %rdx, %rax
shrq $0x2, %rcx
andq %rdx, %rcx
addq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
addq %rcx, %rax
movabsq $0xf0f0f0f0f0f0f0f, %rcx # imm = 0xF0F0F0F0F0F0F0F
andq %rcx, %rax
movabsq $0x101010101010101, %rcx # imm = 0x101010101010101
imulq %rcx, %rax
shrq $0x38, %rax
cltq
addq -0x18(%rsp), %rax
movq %rax, -0x18(%rsp)
movq -0x8(%rsp), %rax
movq (%rax), %rax
movq -0x28(%rsp), %rcx
movq 0x8(%rax,%rcx,8), %rcx
movq %rcx, %rax
shrq %rax
movabsq $0x5555555555555555, %rdx # imm = 0x5555555555555555
andq %rdx, %rax
subq %rax, %rcx
movabsq $0x3333333333333333, %rdx # imm = 0x3333333333333333
movq %rcx, %rax
andq %rdx, %rax
shrq $0x2, %rcx
andq %rdx, %rcx
addq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
addq %rcx, %rax
movabsq $0xf0f0f0f0f0f0f0f, %rcx # imm = 0xF0F0F0F0F0F0F0F
andq %rcx, %rax
movabsq $0x101010101010101, %rcx # imm = 0x101010101010101
imulq %rcx, %rax
shrq $0x38, %rax
cltq
addq -0x18(%rsp), %rax
movq %rax, -0x18(%rsp)
movq -0x8(%rsp), %rax
movq (%rax), %rax
movq -0x28(%rsp), %rcx
movq 0x10(%rax,%rcx,8), %rcx
movq %rcx, %rax
shrq %rax
movabsq $0x5555555555555555, %rdx # imm = 0x5555555555555555
andq %rdx, %rax
subq %rax, %rcx
movabsq $0x3333333333333333, %rdx # imm = 0x3333333333333333
movq %rcx, %rax
andq %rdx, %rax
shrq $0x2, %rcx
andq %rdx, %rcx
addq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
addq %rcx, %rax
movabsq $0xf0f0f0f0f0f0f0f, %rcx # imm = 0xF0F0F0F0F0F0F0F
andq %rcx, %rax
movabsq $0x101010101010101, %rcx # imm = 0x101010101010101
imulq %rcx, %rax
shrq $0x38, %rax
cltq
addq -0x18(%rsp), %rax
movq %rax, -0x18(%rsp)
movq -0x8(%rsp), %rax
movq (%rax), %rax
movq -0x28(%rsp), %rcx
movq 0x18(%rax,%rcx,8), %rcx
movq %rcx, %rax
shrq %rax
movabsq $0x5555555555555555, %rdx # imm = 0x5555555555555555
andq %rdx, %rax
subq %rax, %rcx
movabsq $0x3333333333333333, %rdx # imm = 0x3333333333333333
movq %rcx, %rax
andq %rdx, %rax
shrq $0x2, %rcx
andq %rdx, %rcx
addq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
addq %rcx, %rax
movabsq $0xf0f0f0f0f0f0f0f, %rcx # imm = 0xF0F0F0F0F0F0F0F
andq %rcx, %rax
movabsq $0x101010101010101, %rcx # imm = 0x101010101010101
imulq %rcx, %rax
shrq $0x38, %rax
cltq
addq -0x18(%rsp), %rax
movq %rax, -0x18(%rsp)
movq -0x28(%rsp), %rax
addq $0x4, %rax
movq %rax, -0x28(%rsp)
jmp 0x4a23
jmp 0x4c2b
movq -0x28(%rsp), %rax
movq -0x8(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x4cc8
movq -0x8(%rsp), %rax
movq (%rax), %rax
movq -0x28(%rsp), %rcx
movq (%rax,%rcx,8), %rcx
movq %rcx, %rax
shrq %rax
movabsq $0x5555555555555555, %rdx # imm = 0x5555555555555555
andq %rdx, %rax
subq %rax, %rcx
movabsq $0x3333333333333333, %rdx # imm = 0x3333333333333333
movq %rcx, %rax
andq %rdx, %rax
shrq $0x2, %rcx
andq %rdx, %rcx
addq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
addq %rcx, %rax
movabsq $0xf0f0f0f0f0f0f0f, %rcx # imm = 0xF0F0F0F0F0F0F0F
andq %rcx, %rax
movabsq $0x101010101010101, %rcx # imm = 0x101010101010101
imulq %rcx, %rax
shrq $0x38, %rax
cltq
addq -0x18(%rsp), %rax
movq %rax, -0x18(%rsp)
movq -0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rsp)
jmp 0x4c2b
jmp 0x4cca
movq -0x18(%rsp), %rax
retq