// File: 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
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x27c8
movl $0x0, -0x14(%rbp)
cmpl $0x4, -0x14(%rbp)
jge 0x27b8
movl $0x0, -0x18(%rbp)
cmpl $0xd, -0x18(%rbp)
jge 0x27a8
movl $0x50, %edi
callq 0x2190
movq %rax, %rdi
movq %rdi, -0x30(%rbp)
callq 0x3430
movq -0x30(%rbp), %rax
movq %rax, -0x20(%rbp)
movl -0x14(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x4(%rax)
cmpl $0x0, -0x14(%rbp)
jne 0x24c0
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
leaq 0x4b4b(%rip), %rsi      # 0x7004
callq 0x21c0
jmp 0x2518
cmpl $0x1, -0x14(%rbp)
jne 0x24dc
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
leaq 0x4b36(%rip), %rsi      # 0x700b
callq 0x21c0
jmp 0x2516
cmpl $0x2, -0x14(%rbp)
jne 0x24f8
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
leaq 0x4b20(%rip), %rsi      # 0x7011
callq 0x21c0
jmp 0x2514
cmpl $0x3, -0x14(%rbp)
jne 0x2512
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
leaq 0x4b0d(%rip), %rsi      # 0x701a
callq 0x21c0
jmp 0x2514
jmp 0x2516
jmp 0x2518
movl -0x18(%rbp), %eax
addl $0x1, %eax
cmpl $0x1, %eax
jne 0x2546
movq -0x20(%rbp), %rax
movl $0xb, (%rax)
movq -0x20(%rbp), %rdi
addq $0x28, %rdi
leaq 0x4ae5(%rip), %rsi      # 0x7021
callq 0x21c0
jmp 0x278d
movl -0x18(%rbp), %eax
addl $0x1, %eax
cmpl $0x2, %eax
jne 0x2576
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rdi
addq $0x28, %rdi
leaq 0x4ab9(%rip), %rsi      # 0x7025
callq 0x21c0
jmp 0x278b
movl -0x18(%rbp), %eax
addl $0x1, %eax
cmpl $0x3, %eax
jne 0x25a6
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rdi
addq $0x28, %rdi
leaq 0x4a8d(%rip), %rsi      # 0x7029
callq 0x21c0
jmp 0x2789
movl -0x18(%rbp), %eax
addl $0x1, %eax
cmpl $0x4, %eax
jne 0x25d6
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rdi
addq $0x28, %rdi
leaq 0x4a63(%rip), %rsi      # 0x702f
callq 0x21c0
jmp 0x2787
movl -0x18(%rbp), %eax
addl $0x1, %eax
cmpl $0x5, %eax
jne 0x2606
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rdi
addq $0x28, %rdi
leaq 0x4a38(%rip), %rsi      # 0x7034
callq 0x21c0
jmp 0x2785
movl -0x18(%rbp), %eax
addl $0x1, %eax
cmpl $0x6, %eax
jne 0x2636
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rdi
addq $0x28, %rdi
leaq 0x4a0d(%rip), %rsi      # 0x7039
callq 0x21c0
jmp 0x2783
movl -0x18(%rbp), %eax
addl $0x1, %eax
cmpl $0x7, %eax
jne 0x2666
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rdi
addq $0x28, %rdi
leaq 0x49e1(%rip), %rsi      # 0x703d
callq 0x21c0
jmp 0x2781
movl -0x18(%rbp), %eax
addl $0x1, %eax
cmpl $0x8, %eax
jne 0x2696
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rdi
addq $0x28, %rdi
leaq 0x49b7(%rip), %rsi      # 0x7043
callq 0x21c0
jmp 0x277f
movl -0x18(%rbp), %eax
addl $0x1, %eax
cmpl $0x9, %eax
jne 0x26c6
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rdi
addq $0x28, %rdi
leaq 0x498d(%rip), %rsi      # 0x7049
callq 0x21c0
jmp 0x277d
movl -0x18(%rbp), %eax
addl $0x1, %eax
cmpl $0xa, %eax
jne 0x26f6
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rdi
addq $0x28, %rdi
leaq 0x4962(%rip), %rsi      # 0x704e
callq 0x21c0
jmp 0x277b
movl -0x18(%rbp), %eax
addl $0x1, %eax
cmpl $0xb, %eax
jne 0x2721
movq -0x20(%rbp), %rax
movl $0xa, (%rax)
movq -0x20(%rbp), %rdi
addq $0x28, %rdi
leaq 0x4938(%rip), %rsi      # 0x7052
callq 0x21c0
jmp 0x2779
movl -0x18(%rbp), %eax
addl $0x1, %eax
cmpl $0xc, %eax
jne 0x274c
movq -0x20(%rbp), %rax
movl $0xa, (%rax)
movq -0x20(%rbp), %rdi
addq $0x28, %rdi
leaq 0x4912(%rip), %rsi      # 0x7057
callq 0x21c0
jmp 0x2777
movl -0x18(%rbp), %eax
addl $0x1, %eax
cmpl $0xd, %eax
jne 0x2775
movq -0x20(%rbp), %rax
movl $0xa, (%rax)
movq -0x20(%rbp), %rdi
addq $0x28, %rdi
leaq 0x48ed(%rip), %rsi      # 0x705d
callq 0x21c0
jmp 0x2777
jmp 0x2779
jmp 0x277b
jmp 0x277d
jmp 0x277f
jmp 0x2781
jmp 0x2783
jmp 0x2785
jmp 0x2787
jmp 0x2789
jmp 0x278b
jmp 0x278d
movq -0x28(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x3460
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x2472
jmp 0x27aa
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2461
jmp 0x27ba
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x244e
addq $0x30, %rsp
popq %rbp
retq
nop