// File: /workspace/github_cpp_makefile_star2_O2/renzibei[P]TSProxy/aes.cpp
// Function: aes(char*, char const*)
void aes(char *p, const char *key){

	int pArray[4][4];
	int i;

	extendKey(key);//扩展密钥

    // 开始加密
    strToArray(p, pArray);
    addKey(pArray, 0);//一开始的轮密钥加

    // 中间九轮
    for(i = 1; i < 10; i++){
        subBytes(pArray);//字节代换
        shiftRows(pArray);//行移位
        mixColumns(pArray);//列混合
        addKey(pArray, i);
    }

    // 最后一轮
    subBytes(pArray);//字节代换
    shiftRows(pArray);//行移位
    addKey(pArray, 10);

    arrayToStr(pArray, p);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdi, 0x8(%rsp)
xorl %edx, %edx
pushq $0x18
popq %rdi
leaq 0xb6b9e(%rip), %rax     # 0xbccf0
cmpq $0x4, %rdx
je 0x6186
xorl %r8d, %r8d
movl %edi, %ecx
xorl %r9d, %r9d
cmpq $0x4, %r8
je 0x6179
movzbl (%rsi,%r8), %r10d
shll %cl, %r10d
orl %r10d, %r9d
incq %r8
addl $-0x8, %ecx
jmp 0x6160
movl %r9d, (%rax,%rdx,4)
incq %rdx
addq $0x4, %rsi
jmp 0x6152
xorl %ecx, %ecx
pushq $0x4
popq %rdx
movl $0xff, %esi
leaq 0x21c9(%rip), %rdi      # 0x8360
leaq 0x1dc2(%rip), %r8       # 0x7f60
cmpq $0x2c, %rdx
je 0x6260
movl -0x10(%rax,%rdx,4), %r9d
movl -0x4(%rax,%rdx,4), %r10d
testb $0x3, %dl
je 0x61c3
xorl %r9d, %r10d
movl %r10d, (%rax,%rdx,4)
jmp 0x6258
movl %r10d, %r11d
shrl $0x18, %r11d
movl %r11d, 0x2c(%rsp)
movl %r10d, %r11d
shrl $0x10, %r11d
andl %esi, %r11d
movl %r11d, 0x20(%rsp)
movl %r10d, %r11d
shrl $0x8, %r11d
andl %esi, %r11d
movl %r11d, 0x24(%rsp)
andl %esi, %r10d
movl %r10d, 0x28(%rsp)
xorl %r10d, %r10d
cmpq $0x4, %r10
je 0x6222
movl 0x20(%rsp,%r10,4), %r11d
movl %r11d, %ebx
andl $0xf, %ebx
andl $0xf0, %r11d
leaq (%r8,%r11,4), %r11
movl (%r11,%rbx,4), %r11d
movl %r11d, 0x20(%rsp,%r10,4)
incq %r10
jmp 0x61f8
movl 0x20(%rsp), %r10d
movl 0x24(%rsp), %r11d
shll $0x18, %r10d
shll $0x10, %r11d
orl %r10d, %r11d
movl 0x28(%rsp), %r10d
shll $0x8, %r10d
orl %r11d, %r10d
orl 0x2c(%rsp), %r10d
movslq %ecx, %rcx
xorl (%rdi,%rcx,4), %r10d
xorl %r9d, %r10d
movl %r10d, (%rax,%rdx,4)
incl %ecx
incq %rdx
jmp 0x619e
leaq 0x60(%rsp), %rax
xorl %ecx, %ecx
movq 0x8(%rsp), %rdx
cmpq $0x4, %rcx
je 0x629b
movq %rax, %rsi
xorl %edi, %edi
cmpq $0x4, %rdi
je 0x628e
movzbl (%rdx,%rdi), %r8d
movl %r8d, (%rsi)
incq %rdi
addq $0x10, %rsi
jmp 0x6277
incq %rcx
addq $0x4, %rdx
addq $0x4, %rax
jmp 0x626c
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x6403
pushq $0x1
popq %rbp
movq %rbx, %rdi
callq 0x647b
movq %rbx, %rdi
callq 0x64bc
cmpl $0xa, %ebp
je 0x63b4
movl %ebp, (%rsp)
movq %rbx, %rax
leaq 0x20(%rsp), %rcx
xorl %edx, %edx
cmpq $0x4, %rdx
je 0x62f9
xorl %esi, %esi
cmpq $0x4, %rsi
je 0x62ec
movl (%rax,%rsi,4), %edi
movl %edi, (%rcx,%rsi,4)
incq %rsi
jmp 0x62db
incq %rdx
addq $0x10, %rcx
addq $0x10, %rax
jmp 0x62d3
movq %rbx, 0x10(%rsp)
xorl %eax, %eax
cmpq $0x4, %rax
je 0x63a0
movq %rax, 0x18(%rsp)
shlq $0x4, %rax
leaq 0x2076(%rip), %rcx      # 0x8390
movl (%rax,%rcx), %edx
movl %edx, 0x4(%rsp)
movl 0x4(%rax,%rcx), %r12d
movl 0x8(%rax,%rcx), %r13d
movl 0xc(%rax,%rcx), %r14d
xorl %r15d, %r15d
cmpq $0x4, %r15
je 0x6388
movl 0x20(%rsp,%r15,4), %esi
movl 0x4(%rsp), %edi
callq 0x6d5f
movl %eax, %ebp
movl 0x30(%rsp,%r15,4), %esi
movl %r12d, %edi
callq 0x6d5f
movl %eax, %ebx
xorl %ebp, %ebx
movl 0x40(%rsp,%r15,4), %esi
movl %r13d, %edi
callq 0x6d5f
movl %eax, %ebp
movl 0x50(%rsp,%r15,4), %esi
movl %r14d, %edi
callq 0x6d5f
xorl %ebp, %eax
xorl %ebx, %eax
movq 0x10(%rsp), %rcx
movl %eax, (%rcx,%r15,4)
incq %r15
jmp 0x6333
movq 0x18(%rsp), %rax
incq %rax
addq $0x10, 0x10(%rsp)
leaq 0x60(%rsp), %rbx
jmp 0x6300
movq %rbx, %rdi
movl (%rsp), %ebp
movl %ebp, %esi
callq 0x6403
incl %ebp
jmp 0x62ad
leaq 0x60(%rsp), %r14
pushq $0xa
popq %rsi
movq %r14, %rdi
callq 0x6403
xorl %eax, %eax
movq 0x8(%rsp), %rsi
cmpq $0x4, %rax
je 0x63f1
xorl %ecx, %ecx
cmpq $0x40, %rcx
je 0x63e8
movb (%r14,%rcx), %dl
movb %dl, (%rsi)
incq %rsi
addq $0x10, %rcx
jmp 0x63d3
incq %rax
addq $0x4, %r14
jmp 0x63cb
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq