// File: arisKoutsou[P]oopproj/./src/game_utils.cpp
// Function: fillMarketSpells(Market*, int)
void fillMarketSpells(Market* market, int size) {
  for (int i = 0; i != size; ++i) {
    int kind = rng.fromMintoMax(0, 2);
    string name = spells[rng.fromMintoMax(0, spells.size() - 1)];
    switch (kind) {
    case 0: {
      FireSpell* newFireSpell = new FireSpell(name);
      market->addSpell(newFireSpell);
      break;
    }
    case 1: {
      IceSpell* newIceSpell = new IceSpell(name);
      market->addSpell(newIceSpell);
      break;
    }
    case 2: {
      LightningSpell* newLightningSpell = new LightningSpell(name);
      market->addSpell(newLightningSpell);
      break;
    }
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0xc(%rbp), %eax
je 0xdd71
xorl %edi, %edi
movl %edi, -0xe4(%rbp)
movl $0x2, %esi
callq 0x6040
movl %eax, -0x14(%rbp)
leaq 0x32977(%rip), %rdi     # 0x403a8
movq %rdi, -0xe0(%rbp)
callq 0x6390
movl -0xe4(%rbp), %edi
movl %eax, %esi
decl %esi
callq 0x6040
movq -0xe0(%rbp), %rdi
movslq %eax, %rsi
callq 0x132f0
movq %rax, %rsi
leaq -0x38(%rbp), %rdi
callq 0x5120
movl -0x14(%rbp), %eax
movl %eax, -0xd8(%rbp)
testl %eax, %eax
je 0xda9b
jmp 0xda76
movl -0xd8(%rbp), %eax
subl $0x1, %eax
je 0xdb7f
jmp 0xda87
movl -0xd8(%rbp), %eax
subl $0x2, %eax
je 0xdc67
jmp 0xdd4f
movl $0x58, %edi
callq 0x5300
movq %rax, -0xf0(%rbp)
jmp 0xdaae
movb $0x1, -0x71(%rbp)
leaq -0x70(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x5120
jmp 0xdac1
movq -0xf0(%rbp), %rdi
movq %rsp, %rax
movl $0x3, 0x8(%rax)
movl $0x64, (%rax)
leaq -0x70(%rbp), %rsi
movl $0x14, %edx
movl $0x1, %ecx
movl $0xa, %r8d
movl $0x50, %r9d
movsd 0x208f6(%rip), %xmm0    # 0x2e3f0
callq 0x21130
jmp 0xdb01
movb $0x0, -0x71(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x55d0
movq -0xf0(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x1ffb0
jmp 0xdb28
jmp 0xdd4f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xdd66
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xdb61
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 0xdb69
jmp 0xdb7a
movq -0xf0(%rbp), %rdi
movl $0x58, %esi
callq 0x5310
jmp 0xdd66
movl $0x58, %edi
callq 0x5300
movq %rax, -0xf8(%rbp)
jmp 0xdb92
movb $0x1, -0xa1(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x5120
jmp 0xdbab
movq -0xf8(%rbp), %rdi
movq %rsp, %rax
movl $0x2, 0x8(%rax)
movl $0x64, (%rax)
leaq -0xa0(%rbp), %rsi
movl $0x14, %edx
movl $0x1, %ecx
movl $0xa, %r8d
movl $0x50, %r9d
movsd 0x20821(%rip), %xmm0    # 0x2e408
callq 0x20190
jmp 0xdbee
movb $0x0, -0xa1(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x55d0
movq -0xf8(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x8(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x1ffb0
jmp 0xdc1b
jmp 0xdd4f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xdc46
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x55d0
testb $0x1, -0xa1(%rbp)
jne 0xdc51
jmp 0xdc62
movq -0xf8(%rbp), %rdi
movl $0x58, %esi
callq 0x5310
jmp 0xdd66
movl $0x58, %edi
callq 0x5300
movq %rax, -0x100(%rbp)
jmp 0xdc7a
movb $0x1, -0xd1(%rbp)
leaq -0xd0(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x5120
jmp 0xdc93
movq -0x100(%rbp), %rdi
movq %rsp, %rax
movl $0x1, 0x8(%rax)
movl $0x64, (%rax)
leaq -0xd0(%rbp), %rsi
movl $0x14, %edx
movl $0x1, %ecx
movl $0xa, %r8d
movl $0x50, %r9d
movsd 0x20731(%rip), %xmm0    # 0x2e400
callq 0x20970
jmp 0xdcd6
movb $0x0, -0xd1(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x55d0
movq -0x100(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x8(%rbp), %rdi
movq -0xb0(%rbp), %rsi
callq 0x1ffb0
jmp 0xdd09
jmp 0xdd4f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xdd31
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x55d0
testb $0x1, -0xd1(%rbp)
jne 0xdd3c
jmp 0xdd4d
movq -0x100(%rbp), %rdi
movl $0x58, %esi
callq 0x5310
jmp 0xdd66
leaq -0x38(%rbp), %rdi
callq 0x55d0
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0xda09
leaq -0x38(%rbp), %rdi
callq 0x55d0
jmp 0xdd7a
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x5550
nopw %cs:(%rax,%rax)