// File: /workspace/github_cpp_makefile_star2_O1/ogghead[P]Moon_Boersma_Coe_CSCI2270_FinalProject/Blackjack.cpp
// Function: Blackjack::buildDeck(int)
void Blackjack::buildDeck(int deckNumber){
    for (int s = 0; s < deckNumber; s++){

        for(int i=0;i<4;i++){//four suits
            for(int j=0; j<13;j++){//13 cards per suit
                card *newCard = new card;
                newCard->suit=i;
                if(i==0){
                    newCard->sui="Hearts";
                }
                else if(i==1){newCard->sui="Clubs";}
                else if(i==2){newCard->sui="Diamonds";}
                else if(i==3){newCard->sui="Spades";}

                if (j+1 == 1){
                    newCard->value = 11;
                    newCard->name = "Ace";
                }
                    else if (j+1 == 2){
                        newCard->value = j + 1;
                        newCard->name = "Two";
                    }
                    else if (j+1 == 3){
                        newCard->value = j + 1;
                        newCard->name = "Three";
                    }
                    else if (j+1 == 4){
                        newCard->value = j + 1;
                        newCard->name = "Four";
                    }
                    else if (j+1 == 5){
                        newCard->value = j + 1;
                        newCard->name = "Five";
                    }
                    else if (j+1 == 6){
                        newCard->value = j + 1;
                        newCard->name = "Six";
                    }
                    else if (j+1 == 7){
                        newCard->value = j + 1;
                        newCard->name = "Seven";
                    }
                    else if (j+1 == 8){
                        newCard->value = j + 1;
                        newCard->name = "Eight";
                    }
                    else if (j+1 == 9){
                        newCard->value = j + 1;
                        newCard->name = "Nine";
                    }
                    else if (j+1 == 10){
                        newCard->value = j + 1;
                        newCard->name = "Ten";
                    }
                    else if (j+1 == 11){
                        newCard->value = 10;
                        newCard->name = "Jack";
                    }
                    else if (j+1 == 12){
                        newCard->value = 10;
                        newCard->name = "Queen";
                    }
                    else if (j+1 == 13){
                        newCard->value = 10;
                        newCard->name = "King";
                    }
                    //cout<<newCard->name<< " " << newCard->sui<<endl;

                    deck.push_back(newCard);
                }
            }
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, -0x34(%rbp)
testl %esi, %esi
jle 0x26ff
movq %rdi, %r14
xorl %ebx, %ebx
leaq 0x2c16(%rip), %r12      # 0x5014
xorl %eax, %eax
movl %eax, -0x38(%rbp)
xorl %r15d, %r15d
xorl %r13d, %r13d
movl %r15d, %eax
movq %rax, -0x40(%rbp)
movl $0x50, %edi
callq 0x2140
leaq 0x18(%rax), %rcx
movq %rcx, 0x8(%rax)
movq %rbx, 0x10(%rax)
movb %bl, 0x18(%rax)
leaq 0x38(%rax), %rcx
movq %rcx, 0x28(%rax)
movq %rbx, 0x30(%rax)
movb %bl, 0x38(%rax)
movq %rax, -0x30(%rbp)
movl %r15d, 0x4(%rax)
cmpl $0x3, %r15d
ja 0x24b8
movq %rax, %rdi
addq $0x8, %rdi
leaq 0x2bb0(%rip), %rdx      # 0x5004
movq -0x40(%rbp), %rcx
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movq 0x10(%rax), %rdx
movl $0x6, %r8d
xorl %esi, %esi
leaq 0x2bd4(%rip), %rcx      # 0x5048
jmp 0x24b3
movq 0x10(%rax), %rdx
movl $0x8, %r8d
xorl %esi, %esi
leaq 0x2bcc(%rip), %rcx      # 0x5055
jmp 0x24b3
movq 0x10(%rax), %rdx
movl $0x6, %r8d
xorl %esi, %esi
leaq 0x2bc0(%rip), %rcx      # 0x505e
jmp 0x24b3
movq 0x10(%rax), %rdx
movl $0x5, %r8d
xorl %esi, %esi
leaq 0x2b9c(%rip), %rcx      # 0x504f
callq 0x21a0
cmpl $0xc, %r13d
ja 0x26b3
movl %r13d, %eax
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
movq -0x30(%rbp), %rdi
movl $0xb, (%rdi)
movq 0x30(%rdi), %rdx
addq $0x28, %rdi
movl $0x3, %r8d
xorl %esi, %esi
leaq 0x2b76(%rip), %rcx      # 0x5065
jmp 0x26ae
movq -0x30(%rbp), %rdi
movl $0xa, (%rdi)
movq 0x30(%rdi), %rdx
addq $0x28, %rdi
movl $0x5, %r8d
xorl %esi, %esi
leaq 0x2b86(%rip), %rcx      # 0x509b
jmp 0x26ae
movq -0x30(%rbp), %rdi
movl $0x5, (%rdi)
movq 0x30(%rdi), %rdx
addq $0x28, %rdi
movl $0x4, %r8d
xorl %esi, %esi
leaq 0x2b3d(%rip), %rcx      # 0x5078
jmp 0x26ae
movq -0x30(%rbp), %rdi
movl $0xa, (%rdi)
movq 0x30(%rdi), %rdx
addq $0x28, %rdi
movl $0x4, %r8d
xorl %esi, %esi
leaq 0x2b40(%rip), %rcx      # 0x50a1
jmp 0x26ae
movq -0x30(%rbp), %rdi
movl $0xa, (%rdi)
movq 0x30(%rdi), %rdx
addq $0x28, %rdi
movl $0x3, %r8d
xorl %esi, %esi
leaq 0x2b0b(%rip), %rcx      # 0x5092
jmp 0x26ae
movq -0x30(%rbp), %rdi
movl $0x3, (%rdi)
movq 0x30(%rdi), %rdx
addq $0x28, %rdi
movl $0x5, %r8d
xorl %esi, %esi
leaq 0x2ac0(%rip), %rcx      # 0x506d
jmp 0x26ae
movq -0x30(%rbp), %rdi
movl $0x4, (%rdi)
movq 0x30(%rdi), %rdx
addq $0x28, %rdi
movl $0x4, %r8d
xorl %esi, %esi
leaq 0x2aa0(%rip), %rcx      # 0x5073
jmp 0x26ae
movq -0x30(%rbp), %rdi
movl $0x8, (%rdi)
movq 0x30(%rdi), %rdx
addq $0x28, %rdi
movl $0x5, %r8d
xorl %esi, %esi
leaq 0x2a8e(%rip), %rcx      # 0x5087
jmp 0x26ae
movq -0x30(%rbp), %rdi
movl $0x2, (%rdi)
movq 0x30(%rdi), %rdx
addq $0x28, %rdi
movl $0x3, %r8d
xorl %esi, %esi
leaq 0x2a4a(%rip), %rcx      # 0x5069
jmp 0x26ae
movq -0x30(%rbp), %rdi
movl $0x6, (%rdi)
movq 0x30(%rdi), %rdx
addq $0x28, %rdi
movl $0x3, %r8d
xorl %esi, %esi
leaq 0x2a38(%rip), %rcx      # 0x507d
jmp 0x26ae
movq -0x30(%rbp), %rdi
movl $0x7, (%rdi)
movq 0x30(%rdi), %rdx
addq $0x28, %rdi
movl $0x5, %r8d
xorl %esi, %esi
leaq 0x2a19(%rip), %rcx      # 0x5081
jmp 0x26ae
movq -0x30(%rbp), %rdi
movl $0xa, (%rdi)
movq 0x30(%rdi), %rdx
addq $0x28, %rdi
movl $0x4, %r8d
xorl %esi, %esi
leaq 0x2a0b(%rip), %rcx      # 0x5096
jmp 0x26ae
movq -0x30(%rbp), %rdi
movl $0x9, (%rdi)
movq 0x30(%rdi), %rdx
addq $0x28, %rdi
movl $0x4, %r8d
xorl %esi, %esi
leaq 0x29df(%rip), %rcx      # 0x508d
callq 0x21a0
movq 0x8(%r14), %rsi
cmpq 0x10(%r14), %rsi
je 0x26cb
movq -0x30(%rbp), %rax
movq %rax, (%rsi)
addq $0x8, 0x8(%r14)
jmp 0x26d7
movq %r14, %rdi
leaq -0x30(%rbp), %rdx
callq 0x30ce
incl %r13d
cmpl $0xd, %r13d
jne 0x2410
incl %r15d
cmpl $0x4, %r15d
jne 0x2406
movl -0x38(%rbp), %eax
incl %eax
cmpl -0x34(%rbp), %eax
jne 0x2400
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq