// File: /workspace/github_cpp_makefile_star2_O2/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
movq %rdi, %r14
xorl %r13d, %r13d
testl %esi, %esi
cmovlel %r13d, %esi
movl %esi, -0x2c(%rbp)
leaq 0x1d61(%rip), %r15      # 0x410c
xorl %eax, %eax
cmpl -0x2c(%rbp), %eax
je 0x2476
movl %eax, -0x30(%rbp)
xorl %ebx, %ebx
cmpl $0x4, %ebx
je 0x246c
movl %ebx, %eax
shlq $0x2, %rax
movq %rax, -0x40(%rbp)
xorl %r12d, %r12d
cmpl $0x34, %r12d
je 0x2465
pushq $0x50
popq %rdi
callq 0x2160
andq $0x0, 0x10(%rax)
leaq 0x18(%rax), %rcx
andq $0x0, 0x30(%rax)
leaq 0x38(%rax), %rdx
movq %rcx, 0x8(%rax)
movb %r13b, 0x18(%rax)
movq %rdx, 0x28(%rax)
movb %r13b, 0x38(%rax)
movq %rax, -0x38(%rbp)
movl %ebx, 0x4(%rax)
cmpl $0x3, %ebx
ja 0x242f
addq $0x8, %rax
leaq 0x1cac(%rip), %rcx      # 0x40c8
movq -0x40(%rbp), %rdx
movslq (%rdx,%rcx), %rsi
addq %rcx, %rsi
movq %rax, %rdi
callq 0x21d0
movq -0x38(%rbp), %rdi
leaq 0x1c9e(%rip), %rax      # 0x40d8
movl (%r12,%rax), %eax
movslq (%r12,%r15), %rsi
addq %r15, %rsi
movl %eax, (%rdi)
addq $0x28, %rdi
callq 0x21d0
movq %r14, %rdi
leaq -0x38(%rbp), %rsi
callq 0x2ad8
addq $0x4, %r12
jmp 0x23d1
incl %ebx
jmp 0x23bb
movl -0x30(%rbp), %eax
incl %eax
jmp 0x23ad
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop