// File: arisKoutsou[P]oopproj/./src/game_utils.cpp
// Function: fillMarketItems(Market*, int)
void fillMarketItems(Market* market, int size) {
  for (int i = 0; i != size; ++i) {
    int kind = rng.fromMintoMax(0, 2);
    switch (kind) {
    case 0: {
      string name = weapons[rng.fromMintoMax(0, weapons.size() - 1)];
      Weapon* newWeapon = new Weapon(name);
      market->addItem(newWeapon);
      break;
    }
    case 1: {
      string name = armors[rng.fromMintoMax(0, armors.size() - 1)];
      Armor* newArmor = new Armor(name);
      market->addItem(newArmor);
      break;
    }
    case 2: {
      string name = potions[rng.fromMintoMax(0, potions.size() - 1)];
      Potion* newPotion = new Potion(name);
      market->addItem(newPotion);
      break;
    }
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0xc(%rbp), %eax
je 0xd9d0
xorl %edi, %edi
movl $0x2, %esi
callq 0x6040
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x118(%rbp)
testl %eax, %eax
je 0xd618
jmp 0xd5f3
movl -0x118(%rbp), %eax
subl $0x1, %eax
je 0xd737
jmp 0xd604
movl -0x118(%rbp), %eax
subl $0x2, %eax
je 0xd876
jmp 0xd9c0
leaq 0x32d41(%rip), %rdi     # 0x40360
movq %rdi, -0x128(%rbp)
callq 0x6390
movl %eax, %esi
decl %esi
xorl %edi, %edi
callq 0x6040
movq -0x128(%rbp), %rdi
movslq %eax, %rsi
callq 0x132f0
movq %rax, %rsi
leaq -0x38(%rbp), %rdi
callq 0x5120
movl $0x48, %edi
callq 0x5300
movq %rax, -0x120(%rbp)
jmp 0xd664
movb $0x1, -0x71(%rbp)
leaq -0x70(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x5120
jmp 0xd677
movq -0x120(%rbp), %rdi
movq %rsp, %rax
movl $0x0, (%rax)
leaq -0x70(%rbp), %rsi
movl $0x19, %edx
movl $0xf, %ecx
movl $0x3, %r8d
movl $0x50, %r9d
callq 0x2bc20
jmp 0xd6a8
movb $0x0, -0x71(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x55d0
movq -0x120(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x1ff50
jmp 0xd6cf
leaq -0x38(%rbp), %rdi
callq 0x55d0
jmp 0xd9c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xd729
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xd70e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x55d0
testb $0x1, -0x71(%rbp)
jne 0xd716
jmp 0xd727
movq -0x120(%rbp), %rdi
movl $0x48, %esi
callq 0x5310
jmp 0xd729
leaq -0x38(%rbp), %rdi
callq 0x55d0
jmp 0xd9d9
leaq 0x32c3a(%rip), %rdi     # 0x40378
movq %rdi, -0x138(%rbp)
callq 0x6390
movl %eax, %esi
decl %esi
xorl %edi, %edi
callq 0x6040
movq -0x138(%rbp), %rdi
movslq %eax, %rsi
callq 0x132f0
movq %rax, %rsi
leaq -0x98(%rbp), %rdi
callq 0x5120
movl $0x48, %edi
callq 0x5300
movq %rax, -0x130(%rbp)
jmp 0xd786
movb $0x1, -0xc1(%rbp)
leaq -0xc0(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x5120
jmp 0xd7a2
movq -0x130(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
movl $0x19, %edx
movl $0xf, %ecx
movl $0x3, %r8d
movsd 0x20c28(%rip), %xmm0    # 0x2e3f0
callq 0x2c3d0
jmp 0xd7cf
movb $0x0, -0xc1(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x55d0
movq -0x130(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x8(%rbp), %rdi
movq -0xa0(%rbp), %rsi
callq 0x1ff50
jmp 0xd802
leaq -0x98(%rbp), %rdi
callq 0x55d0
jmp 0xd9c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xd865
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xd847
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x55d0
testb $0x1, -0xc1(%rbp)
jne 0xd852
jmp 0xd863
movq -0x130(%rbp), %rdi
movl $0x48, %esi
callq 0x5310
jmp 0xd865
leaq -0x98(%rbp), %rdi
callq 0x55d0
jmp 0xd9d9
leaq 0x32b13(%rip), %rdi     # 0x40390
movq %rdi, -0x148(%rbp)
callq 0x6390
movl %eax, %esi
decl %esi
xorl %edi, %edi
callq 0x6040
movq -0x148(%rbp), %rdi
movslq %eax, %rsi
callq 0x132f0
movq %rax, %rsi
leaq -0xe8(%rbp), %rdi
callq 0x5120
movl $0x60, %edi
callq 0x5300
movq %rax, -0x140(%rbp)
jmp 0xd8c5
movb $0x1, -0x111(%rbp)
leaq -0x110(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x5120
jmp 0xd8e1
movq -0x140(%rbp), %rdi
leaq -0x110(%rbp), %rsi
movl $0x19, %edx
movl $0xf, %ecx
movl $0x3, %r8d
movsd 0x20ae9(%rip), %xmm0    # 0x2e3f0
xorps %xmm1, %xmm1
movsd 0x20ae6(%rip), %xmm2    # 0x2e3f8
movl $0x2, %r9d
callq 0x2ca00
jmp 0xd91f
movb $0x0, -0x111(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x55d0
movq -0x140(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0x8(%rbp), %rdi
movq -0xf0(%rbp), %rsi
callq 0x1ff50
jmp 0xd952
leaq -0xe8(%rbp), %rdi
callq 0x55d0
jmp 0xd9c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xd9b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xd994
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x55d0
testb $0x1, -0x111(%rbp)
jne 0xd99f
jmp 0xd9b0
movq -0x140(%rbp), %rdi
movl $0x60, %esi
callq 0x5310
jmp 0xd9b2
leaq -0xe8(%rbp), %rdi
callq 0x55d0
jmp 0xd9d9
jmp 0xd9c2
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0xd5c9
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x5550
nopw %cs:(%rax,%rax)