// File: /workspace/github_cpp_makefile_star2_O3/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 0x26e5
movq %rdi, %r14
xorl %ebx, %ebx
leaq 0x2c16(%rip), %r15      # 0x5014
xorl %eax, %eax
movl %eax, -0x38(%rbp)
xorl %r12d, %r12d
xorl %r13d, %r13d
movl %r12d, %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 %r12d, 0x4(%rax)
cmpl $0x3, %r12d
ja 0x24db
addq $0x8, %rax
leaq 0x2baf(%rip), %rdx      # 0x5004
movq -0x40(%rbp), %rcx
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movl $0x6, %r8d
movq %rax, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x2bd2(%rip), %rcx      # 0x5048
callq 0x21a0
movq -0x30(%rbp), %rax
leaq 0x28(%rax), %rdi
movl %r13d, %ecx
incl %r13d
movslq (%r15,%rcx,4), %rcx
addq %r15, %rcx
jmpq *%rcx
movl $0x8, %r8d
movq %rax, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x2baf(%rip), %rcx      # 0x5055
callq 0x21a0
movq -0x30(%rbp), %rax
leaq 0x28(%rax), %rdi
movl %r13d, %ecx
incl %r13d
movslq (%r15,%rcx,4), %rcx
addq %r15, %rcx
jmpq *%rcx
movl $0x6, %r8d
movq %rax, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x2b88(%rip), %rcx      # 0x505e
callq 0x21a0
movq -0x30(%rbp), %rax
leaq 0x28(%rax), %rdi
movl %r13d, %ecx
incl %r13d
movslq (%r15,%rcx,4), %rcx
addq %r15, %rcx
jmpq *%rcx
movl $0x5, %r8d
movq %rax, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x2b49(%rip), %rcx      # 0x504f
callq 0x21a0
movq -0x30(%rbp), %rax
leaq 0x28(%rax), %rdi
movl %r13d, %ecx
incl %r13d
movslq (%r15,%rcx,4), %rcx
addq %r15, %rcx
jmpq *%rcx
movl $0xb, (%rax)
movq 0x30(%rax), %rdx
movl $0x3, %r8d
xorl %esi, %esi
leaq 0x2b2a(%rip), %rcx      # 0x5065
jmp 0x2697
movl $0xa, (%rax)
movq 0x30(%rax), %rdx
movl $0x5, %r8d
xorl %esi, %esi
leaq 0x2b42(%rip), %rcx      # 0x509b
jmp 0x2697
movl $0x5, (%rax)
movq 0x30(%rax), %rdx
movl $0x4, %r8d
xorl %esi, %esi
leaq 0x2b01(%rip), %rcx      # 0x5078
jmp 0x2697
movl $0xa, (%rax)
movq 0x30(%rax), %rdx
movl $0x4, %r8d
xorl %esi, %esi
leaq 0x2b0c(%rip), %rcx      # 0x50a1
jmp 0x2697
movl $0xa, (%rax)
movq 0x30(%rax), %rdx
movl $0x3, %r8d
xorl %esi, %esi
leaq 0x2adf(%rip), %rcx      # 0x5092
jmp 0x2697
movl $0x3, (%rax)
movq 0x30(%rax), %rdx
movl $0x5, %r8d
xorl %esi, %esi
leaq 0x2a9c(%rip), %rcx      # 0x506d
jmp 0x2697
movl $0x4, (%rax)
movq 0x30(%rax), %rdx
movl $0x4, %r8d
xorl %esi, %esi
leaq 0x2a84(%rip), %rcx      # 0x5073
jmp 0x2697
movl $0x8, (%rax)
movq 0x30(%rax), %rdx
movl $0x5, %r8d
xorl %esi, %esi
leaq 0x2a7a(%rip), %rcx      # 0x5087
jmp 0x2697
movl $0x2, (%rax)
movq 0x30(%rax), %rdx
movl $0x3, %r8d
xorl %esi, %esi
leaq 0x2a3e(%rip), %rcx      # 0x5069
jmp 0x2697
movl $0x6, (%rax)
movq 0x30(%rax), %rdx
movl $0x3, %r8d
xorl %esi, %esi
leaq 0x2a37(%rip), %rcx      # 0x507d
jmp 0x2697
movl $0x7, (%rax)
movq 0x30(%rax), %rdx
movl $0x5, %r8d
xorl %esi, %esi
leaq 0x2a20(%rip), %rcx      # 0x5081
jmp 0x2697
movl $0xa, (%rax)
movq 0x30(%rax), %rdx
movl $0x4, %r8d
xorl %esi, %esi
leaq 0x2a1a(%rip), %rcx      # 0x5096
jmp 0x2697
movl $0x9, (%rax)
movq 0x30(%rax), %rdx
movl $0x4, %r8d
xorl %esi, %esi
leaq 0x29f6(%rip), %rcx      # 0x508d
callq 0x21a0
movq 0x8(%r14), %rsi
cmpq 0x10(%r14), %rsi
je 0x26b4
movq -0x30(%rbp), %rax
movq %rax, (%rsi)
addq $0x8, 0x8(%r14)
jmp 0x26c0
movq %r14, %rdi
leaq -0x30(%rbp), %rdx
callq 0x30b2
cmpl $0xd, %r13d
jne 0x2410
incl %r12d
cmpl $0x4, %r12d
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