// File: lmclaramunt[P]AES-Crypto/Cipher.cpp
// Function: Cipher::setBlockRoundCombinations(int*, bool)
void Cipher::setBlockRoundCombinations(int* keyLength, bool setKeyPath) {
    switch (*keyLength) {
    case 128:
        Nk = 4, Nr = 10;
        break;
    case 192:
        Nk = 6, Nr = 12;
        break;
    case 256:
        Nk = 8, Nr = 14;
        break;
    default: 
        throw "Invalid Key Length -- Valid: 128, 192, 256"; 
        break;
    }
    if(setKeyPath){ 
        string length = to_string(*keyLength);              //Default AES and MAC keys location
        aesKeyPath = home + "/.AES-" + length + ".aes";
        macKeyPath = home + "/.MAC-" + length + ".aes";   
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x10c(%rbp)
subl $0x80, %eax
je 0x7918
jmp 0x78fa
movl -0x10c(%rbp), %eax
subl $0xc0, %eax
je 0x792f
jmp 0x7909
movl -0x10c(%rbp), %eax
subl $0x100, %eax            # imm = 0x100
je 0x7946
jmp 0x795d
movq -0x118(%rbp), %rax
movl $0x4, 0x18(%rax)
movl $0xa, 0x1c(%rax)
jmp 0x7984
movq -0x118(%rbp), %rax
movl $0x6, 0x18(%rax)
movl $0xc, 0x1c(%rax)
jmp 0x7984
movq -0x118(%rbp), %rax
movl $0x8, 0x18(%rax)
movl $0xe, 0x1c(%rax)
jmp 0x7984
movl $0x8, %edi
callq 0x3120
movq %rax, %rdi
leaq 0x7de9(%rip), %rax      # 0xf75a
movq %rax, (%rdi)
movq 0xe645(%rip), %rsi      # 0x15fc0
xorl %eax, %eax
movl %eax, %edx
callq 0x3490
testb $0x1, -0x11(%rbp)
je 0x7b5d
movq -0x10(%rbp), %rax
movl (%rax), %esi
leaq -0x38(%rbp), %rdi
callq 0xb020
movq -0x118(%rbp), %rsi
addq $0x30, %rsi
leaq 0x7dd6(%rip), %rdx      # 0xf785
leaq -0x98(%rbp), %rdi
callq 0xb1e0
jmp 0x79bd
leaq -0x78(%rbp), %rdi
leaq -0x98(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0xb190
jmp 0x79d3
leaq 0x7db2(%rip), %rdx      # 0xf78c
leaq -0x58(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0xb140
jmp 0x79e9
movq -0x118(%rbp), %rdi
addq $0x50, %rdi
leaq -0x58(%rbp), %rsi
movq %rsi, -0x120(%rbp)
callq 0x3330
movq -0x120(%rbp), %rdi
callq 0x3180
leaq -0x78(%rbp), %rdi
callq 0x3180
leaq -0x98(%rbp), %rdi
callq 0x3180
movq -0x118(%rbp), %rsi
addq $0x30, %rsi
leaq 0x7d5a(%rip), %rdx      # 0xf791
leaq -0x108(%rbp), %rdi
callq 0xb1e0
jmp 0x7a45
leaq -0xe8(%rbp), %rdi
leaq -0x108(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0xb190
jmp 0x7a5e
leaq 0x7d27(%rip), %rdx      # 0xf78c
leaq -0xc8(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0xb140
jmp 0x7a7a
movq -0x118(%rbp), %rdi
addq $0x70, %rdi
leaq -0xc8(%rbp), %rsi
callq 0x3330
leaq -0xc8(%rbp), %rdi
callq 0x3180
leaq -0xe8(%rbp), %rdi
callq 0x3180
leaq -0x108(%rbp), %rdi
callq 0x3180
leaq -0x38(%rbp), %rdi
callq 0x3180
jmp 0x7b5d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x7b52
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x7b06
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x3180
leaq -0x98(%rbp), %rdi
callq 0x3180
jmp 0x7b52
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x7b46
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x3180
leaq -0x108(%rbp), %rdi
callq 0x3180
leaq -0x38(%rbp), %rdi
callq 0x3180
jmp 0x7b66
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
movq -0xa0(%rbp), %rdi
callq 0x34d0
nopw %cs:(%rax,%rax)