// File: /workspace/github_cpp_makefile_star2_O3/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 0xdb5(%rip), %rdi       # 0x65df
leaq 0xab5(%rip), %rsi       # 0x62e6
callq 0x22e0
testq %rax, %rax
je 0x5a09
leaq 0x100(%rbx), %rdi
movl $0x1, %esi
movl $0x10, %edx
movq %rax, %rcx
movq %rax, %r14
callq 0x2350
cmpl $0x10, %eax
jne 0x5a1c
movq %r14, %rdi
callq 0x2240
vmovdqa 0x100(%rbx), %xmm1
vxorps %xmm0, %xmm0, %xmm0
vaeskeygenassist $0x1, %xmm1, %xmm2
vshufps $0x10, %xmm1, %xmm0, %xmm3 # xmm3 = xmm0[0,0],xmm1[1,0]
vmovdqa %xmm1, (%rbx)
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
vaeskeygenassist $0x2, %xmm2, %xmm1
vshufps $0x10, %xmm2, %xmm0, %xmm3 # xmm3 = xmm0[0,0],xmm2[1,0]
vmovdqa %xmm2, 0x10(%rbx)
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
vaeskeygenassist $0x4, %xmm1, %xmm2
vshufps $0x10, %xmm1, %xmm0, %xmm3 # xmm3 = xmm0[0,0],xmm1[1,0]
vmovdqa %xmm1, 0x20(%rbx)
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
vaeskeygenassist $0x8, %xmm2, %xmm1
vshufps $0x10, %xmm2, %xmm0, %xmm3 # xmm3 = xmm0[0,0],xmm2[1,0]
vmovdqa %xmm2, 0x30(%rbx)
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
vaeskeygenassist $0x10, %xmm1, %xmm2
vshufps $0x10, %xmm1, %xmm0, %xmm3 # xmm3 = xmm0[0,0],xmm1[1,0]
vmovdqa %xmm1, 0x40(%rbx)
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
vaeskeygenassist $0x20, %xmm2, %xmm1
vshufps $0x10, %xmm2, %xmm0, %xmm3 # xmm3 = xmm0[0,0],xmm2[1,0]
vmovdqa %xmm2, 0x50(%rbx)
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
vaeskeygenassist $0x40, %xmm1, %xmm2
vshufps $0x10, %xmm1, %xmm0, %xmm3 # xmm3 = xmm0[0,0],xmm1[1,0]
vmovdqa %xmm1, 0x60(%rbx)
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
vaeskeygenassist $0x80, %xmm2, %xmm1
vshufps $0x10, %xmm2, %xmm0, %xmm3 # xmm3 = xmm0[0,0],xmm2[1,0]
vmovdqa %xmm2, 0x70(%rbx)
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
vaeskeygenassist $0x1b, %xmm1, %xmm2
vshufps $0x10, %xmm1, %xmm0, %xmm3 # xmm3 = xmm0[0,0],xmm1[1,0]
vmovdqa %xmm1, 0x80(%rbx)
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
vaeskeygenassist $0x36, %xmm2, %xmm1
vshufps $0x10, %xmm2, %xmm0, %xmm0 # xmm0 = xmm0[0,0],xmm2[1,0]
vmovdqa %xmm2, 0x90(%rbx)
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 0xbb6(%rip), %rcx       # 0x65d0
jmp 0x5a2d
movl $0x8, %edi
callq 0x2120
leaq 0xbbf(%rip), %rcx       # 0x65ec
movq 0x358c(%rip), %rsi      # 0x8fc0
movq %rcx, (%rax)
movq %rax, %rdi
xorl %edx, %edx
callq 0x23d0
nop