// File: cegme[P]vose/test.cc
// Function: test::test1()
bool test::test1() {
  std::cerr << "\nAdd several marbles, return correct weight and size.\n";
  
  Vose vose;

  std::cerr << "\tAdd m('red',5): ";
  double red_score = vose.add("red", 5);
  std::cerr << red_score << "\n";
  assert(red_score == 1);

  std::cerr << "\tAdd m('blue',10): ";
  std::cerr << vose.add("blue", 10) << "\n";

  std::cerr << "\tAdd m('yellow',20): ";
  double yellow_score = vose.add("yellow", 20);
  std::cerr << yellow_score << "\n";
  assert(yellow_score == 20.0/(5+10+20));

  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq %rdi, -0x8(%rbp)
movq 0x15bfa(%rip), %rdi     # 0x2aff0
movq %rdi, -0x138(%rbp)
leaq 0x6e8c(%rip), %rsi      # 0x1c290
callq 0x2210
leaq -0x98(%rbp), %rdi
callq 0x4480
movq -0x138(%rbp), %rdi
leaq 0x6ea4(%rip), %rsi      # 0x1c2c7
callq 0x2210
jmp 0x1542a
leaq -0xd1(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x2300
movq -0x140(%rbp), %rdx
leaq 0x6e8e(%rip), %rsi      # 0x1c2d9
leaq -0xd0(%rbp), %rdi
callq 0x2270
jmp 0x15459
leaq -0x98(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
movl $0x5, %edx
callq 0x10c00
movsd %xmm0, -0x148(%rbp)
jmp 0x1547b
leaq -0xd0(%rbp), %rdi
callq 0x2140
leaq -0xd1(%rbp), %rdi
callq 0x2240
movsd -0x148(%rbp), %xmm0
movsd %xmm0, -0xb0(%rbp)
movsd -0xb0(%rbp), %xmm0
movq 0x15b3e(%rip), %rdi     # 0x2aff0
callq 0x2320
movq %rax, -0x150(%rbp)
jmp 0x154c0
movq -0x150(%rbp), %rdi
leaq 0x704e(%rip), %rsi      # 0x1c51c
callq 0x2210
jmp 0x154d5
movsd -0xb0(%rbp), %xmm0
movsd 0x6b23(%rip), %xmm1     # 0x1c008
ucomisd %xmm1, %xmm0
jne 0x154ef
jp 0x154ef
jmp 0x15568
leaq 0x6de7(%rip), %rdi      # 0x1c2dd
leaq 0x6def(%rip), %rsi      # 0x1c2ec
movl $0x16, %edx
leaq 0x6deb(%rip), %rcx      # 0x1c2f4
callq 0x2150
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x157ad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x15557
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x2140
leaq -0xd1(%rbp), %rdi
callq 0x2240
jmp 0x157ad
movq 0x15a81(%rip), %rdi     # 0x2aff0
leaq 0x6d91(%rip), %rsi      # 0x1c307
callq 0x2210
jmp 0x1557d
leaq -0xf9(%rbp), %rdi
movq %rdi, -0x158(%rbp)
callq 0x2300
movq -0x158(%rbp), %rdx
leaq 0x6f12(%rip), %rsi      # 0x1c4b0
leaq -0xf8(%rbp), %rdi
callq 0x2270
jmp 0x155ac
leaq -0x98(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
movl $0xa, %edx
callq 0x10c00
movsd %xmm0, -0x160(%rbp)
jmp 0x155ce
movsd -0x160(%rbp), %xmm0
movq 0x15a13(%rip), %rdi     # 0x2aff0
callq 0x2320
movq %rax, -0x168(%rbp)
jmp 0x155eb
movq -0x168(%rbp), %rdi
leaq 0x6f23(%rip), %rsi      # 0x1c51c
callq 0x2210
jmp 0x15600
leaq -0xf8(%rbp), %rdi
callq 0x2140
leaq -0xf9(%rbp), %rdi
callq 0x2240
movq 0x159d1(%rip), %rdi     # 0x2aff0
leaq 0x6cf5(%rip), %rsi      # 0x1c31b
callq 0x2210
jmp 0x1562d
leaq -0x129(%rbp), %rdi
movq %rdi, -0x170(%rbp)
callq 0x2300
movq -0x170(%rbp), %rdx
leaq 0x6ce3(%rip), %rsi      # 0x1c331
leaq -0x128(%rbp), %rdi
callq 0x2270
jmp 0x1565c
leaq -0x98(%rbp), %rdi
leaq -0x128(%rbp), %rsi
movl $0x14, %edx
callq 0x10c00
movsd %xmm0, -0x178(%rbp)
jmp 0x1567e
leaq -0x128(%rbp), %rdi
callq 0x2140
leaq -0x129(%rbp), %rdi
callq 0x2240
movsd -0x178(%rbp), %xmm0
movsd %xmm0, -0x108(%rbp)
movsd -0x108(%rbp), %xmm0
movq 0x1593b(%rip), %rdi     # 0x2aff0
callq 0x2320
movq %rax, -0x180(%rbp)
jmp 0x156c3
movq -0x180(%rbp), %rdi
leaq 0x6e4b(%rip), %rsi      # 0x1c51c
callq 0x2210
jmp 0x156d8
movsd -0x108(%rbp), %xmm0
movsd 0x6b80(%rip), %xmm1     # 0x1c268
ucomisd %xmm1, %xmm0
jne 0x156f5
jp 0x156f5
jmp 0x15794
leaq 0x6c3c(%rip), %rdi      # 0x1c338
leaq 0x6be9(%rip), %rsi      # 0x1c2ec
movl $0x1e, %edx
leaq 0x6be5(%rip), %rcx      # 0x1c2f4
callq 0x2150
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x15746
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0x2140
leaq -0xf9(%rbp), %rdi
callq 0x2240
jmp 0x157ad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x15786
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x2140
leaq -0x129(%rbp), %rdi
callq 0x2240
jmp 0x157ad
leaq -0x98(%rbp), %rdi
callq 0x46f0
movb $0x1, %al
andb $0x1, %al
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
leaq -0x98(%rbp), %rdi
callq 0x46f0
movq -0xa0(%rbp), %rdi
callq 0x22f0
nopw %cs:(%rax,%rax)