// File: /workspace/github_cpp_makefile_star2_O1/jBlinden[P]private-codis/util.cpp
// Function: AESContext::AESContext()
AESContext::AESContext() {
  FILE* f = fopen("/dev/urandom", "r");
  if (f == NULL) {
    throw "unable to open /dev/urandom";
  }

  uint32_t bytesRead = fread(keyBytes, 1, AES_KEY_LEN, f);
  if (bytesRead != AES_KEY_LEN) {
    throw "failed to initialize AES key";
  }

  fclose(f);

  AES_128_Key_Expansion(keyBytes, &key);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xc65(%rip), %rdi       # 0x636f
leaq 0x959(%rip), %rsi       # 0x606a
callq 0x22e0
testq %rax, %rax
je 0x58e9
movq %rax, %r14
leaq 0x100(%rbx), %rdi
movl $0x1, %esi
movl $0x10, %edx
movq %rax, %rcx
callq 0x2350
cmpl $0x10, %eax
jne 0x58fc
movq %r14, %rdi
callq 0x2240
vmovdqa 0x100(%rbx), %xmm1
vmovdqa %xmm1, (%rbx)
vaeskeygenassist $0x1, %xmm1, %xmm2
vxorps %xmm0, %xmm0, %xmm0
vshufps $0x10, %xmm1, %xmm0, %xmm3 # xmm3 = xmm0[0,0],xmm1[1,0]
vxorps %xmm3, %xmm1, %xmm1
vshufps $0x8c, %xmm1, %xmm3, %xmm3 # xmm3 = xmm3[0,3],xmm1[0,2]
vpshufd $0xff, %xmm2, %xmm2     # xmm2 = xmm2[3,3,3,3]
vpternlogq $0x96, %xmm3, %xmm1, %xmm2
vmovdqa %xmm2, 0x10(%rbx)
vaeskeygenassist $0x2, %xmm2, %xmm1
vshufps $0x10, %xmm2, %xmm0, %xmm3 # xmm3 = xmm0[0,0],xmm2[1,0]
vxorps %xmm3, %xmm2, %xmm2
vshufps $0x8c, %xmm2, %xmm3, %xmm3 # xmm3 = xmm3[0,3],xmm2[0,2]
vpshufd $0xff, %xmm1, %xmm1     # xmm1 = xmm1[3,3,3,3]
vpternlogq $0x96, %xmm3, %xmm2, %xmm1
vmovdqa %xmm1, 0x20(%rbx)
vaeskeygenassist $0x4, %xmm1, %xmm2
vshufps $0x10, %xmm1, %xmm0, %xmm3 # xmm3 = xmm0[0,0],xmm1[1,0]
vxorps %xmm3, %xmm1, %xmm1
vshufps $0x8c, %xmm1, %xmm3, %xmm3 # xmm3 = xmm3[0,3],xmm1[0,2]
vpshufd $0xff, %xmm2, %xmm2     # xmm2 = xmm2[3,3,3,3]
vpternlogq $0x96, %xmm3, %xmm1, %xmm2
vmovdqa %xmm2, 0x30(%rbx)
vaeskeygenassist $0x8, %xmm2, %xmm1
vshufps $0x10, %xmm2, %xmm0, %xmm3 # xmm3 = xmm0[0,0],xmm2[1,0]
vxorps %xmm3, %xmm2, %xmm2
vshufps $0x8c, %xmm2, %xmm3, %xmm3 # xmm3 = xmm3[0,3],xmm2[0,2]
vpshufd $0xff, %xmm1, %xmm1     # xmm1 = xmm1[3,3,3,3]
vpternlogq $0x96, %xmm3, %xmm2, %xmm1
vmovdqa %xmm1, 0x40(%rbx)
vaeskeygenassist $0x10, %xmm1, %xmm2
vshufps $0x10, %xmm1, %xmm0, %xmm3 # xmm3 = xmm0[0,0],xmm1[1,0]
vxorps %xmm3, %xmm1, %xmm1
vshufps $0x8c, %xmm1, %xmm3, %xmm3 # xmm3 = xmm3[0,3],xmm1[0,2]
vpshufd $0xff, %xmm2, %xmm2     # xmm2 = xmm2[3,3,3,3]
vpternlogq $0x96, %xmm3, %xmm1, %xmm2
vmovdqa %xmm2, 0x50(%rbx)
vaeskeygenassist $0x20, %xmm2, %xmm1
vshufps $0x10, %xmm2, %xmm0, %xmm3 # xmm3 = xmm0[0,0],xmm2[1,0]
vxorps %xmm3, %xmm2, %xmm2
vshufps $0x8c, %xmm2, %xmm3, %xmm3 # xmm3 = xmm3[0,3],xmm2[0,2]
vpshufd $0xff, %xmm1, %xmm1     # xmm1 = xmm1[3,3,3,3]
vpternlogq $0x96, %xmm3, %xmm2, %xmm1
vmovdqa %xmm1, 0x60(%rbx)
vaeskeygenassist $0x40, %xmm1, %xmm2
vshufps $0x10, %xmm1, %xmm0, %xmm3 # xmm3 = xmm0[0,0],xmm1[1,0]
vxorps %xmm3, %xmm1, %xmm1
vshufps $0x8c, %xmm1, %xmm3, %xmm3 # xmm3 = xmm3[0,3],xmm1[0,2]
vpshufd $0xff, %xmm2, %xmm2     # xmm2 = xmm2[3,3,3,3]
vpternlogq $0x96, %xmm3, %xmm1, %xmm2
vmovdqa %xmm2, 0x70(%rbx)
vaeskeygenassist $0x80, %xmm2, %xmm1
vshufps $0x10, %xmm2, %xmm0, %xmm3 # xmm3 = xmm0[0,0],xmm2[1,0]
vxorps %xmm3, %xmm2, %xmm2
vshufps $0x8c, %xmm2, %xmm3, %xmm3 # xmm3 = xmm3[0,3],xmm2[0,2]
vpshufd $0xff, %xmm1, %xmm1     # xmm1 = xmm1[3,3,3,3]
vpternlogq $0x96, %xmm3, %xmm2, %xmm1
vmovdqa %xmm1, 0x80(%rbx)
vaeskeygenassist $0x1b, %xmm1, %xmm2
vshufps $0x10, %xmm1, %xmm0, %xmm3 # xmm3 = xmm0[0,0],xmm1[1,0]
vxorps %xmm3, %xmm1, %xmm1
vshufps $0x8c, %xmm1, %xmm3, %xmm3 # xmm3 = xmm3[0,3],xmm1[0,2]
vpshufd $0xff, %xmm2, %xmm2     # xmm2 = xmm2[3,3,3,3]
vpternlogq $0x96, %xmm3, %xmm1, %xmm2
vmovdqa %xmm2, 0x90(%rbx)
vaeskeygenassist $0x36, %xmm2, %xmm1
vshufps $0x10, %xmm2, %xmm0, %xmm0 # xmm0 = xmm0[0,0],xmm2[1,0]
vxorps %xmm0, %xmm2, %xmm2
vshufps $0x8c, %xmm2, %xmm0, %xmm0 # xmm0 = xmm0[0,3],xmm2[0,2]
vpshufd $0xff, %xmm1, %xmm1     # xmm1 = xmm1[3,3,3,3]
vpternlogq $0x96, %xmm0, %xmm2, %xmm1
vmovdqa %xmm1, 0xa0(%rbx)
movl $0xa, 0xf0(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0x8, %edi
callq 0x2120
leaq 0xa66(%rip), %rcx       # 0x6360
jmp 0x590d
movl $0x8, %edi
callq 0x2120
leaq 0xa6f(%rip), %rcx       # 0x637c
movq %rcx, (%rax)
movq 0x36a9(%rip), %rsi      # 0x8fc0
movq %rax, %rdi
xorl %edx, %edx
callq 0x23d0
nop