int main() {
  unsigned char T[16];
  const unsigned char T64[16] = {0x51, 0xf0, 0xbe, 0xbf, 0x7e, 0x3b,
                                 0x9d, 0x92, 0xfc, 0x49, 0x74, 0x17,
                                 0x79, 0x36, 0x3c, 0xfe};
  const unsigned char M[64] = {
      0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e,
      0x11, 0x73, 0x93, 0x17, 0x2a, 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03,
      0xac, 0x9c, 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51, 0x30,
      0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11, 0xe5, 0xfb, 0xc1, 0x19,
      0x1a, 0x0a, 0x52, 0xef, 0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b,
      0x17, 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10};
  const unsigned char key[16] = {0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae,
                                 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88,
                                 0x09, 0xcf, 0x4f, 0x3c};
  const unsigned char key2[16] = "password\0\0\0\0\0\0\0\0";
  const unsigned char M2[] = "1234567890;09876543";
  const unsigned char M2_ENC[16 * 3];
  const unsigned char T2[16] = {0xef, 0xf2, 0x2d, 0x3a, 0x78, 0x7b, 0xd8, 0xa5,
                                0x2b, 0xd4, 0x7e, 0xd5, 0x87, 0xd9, 0xb0, 0xd6};
  unsigned char src_str[16 * 5 + 1] = {0};
  unsigned char dst_str[16 * 5 + 1] = {0};
  unsigned char decyph_str[16 * 5 + 1] = {0};
  printf("--------------------------------------------------\n");
  printf("K              ");
  print128(key);
  printf("\n");
  printf("\nExample 1: len = 0\n");
  printf("M              ");
  printf("<empty string>\n");
  AES_CMAC(key, M, 0, T);
  printf("AES_CMAC       ");
  print128(T);
  printf("\n");
  printf("\nExample 2: len = 16\n");
  printf("M              ");
  print_hex("                ", M, 16);
  AES_CMAC(key, M, 16, T);
  printf("AES_CMAC       ");
  print128(T);
  printf("\n");
  printf("\nExample 3: len = 40\n");
  printf("M              ");
  print_hex("               ", M, 40);
  AES_CMAC(key, M, 40, T);
  printf("AES_CMAC       ");
  print128(T);
  printf("\n");
  printf("\nExample 4: len = 64\n");
  printf("M              ");
  print_hex("               ", M, 64);
  AES_CMAC(key, M, 64, T);
  printf("AES_CMAC       ");
  print128(T);
  printf("\n");
  printf("AES_CMAC_CHECK: %d\n", AES_CMAC_CHECK(key, M, 64, T64));
  int ms2 = sizeof(M2) - 1;
  AES_CMAC(key2, M2, ms2, T);
  printf("M2sz:%d\n", ms2);
  printf("AES_CMAC       ");
  print128(T);
  printf("\n");
  printf("AES_CMAC_CHECK: %d\n", AES_CMAC_CHECK(key2, M2, ms2, T2));
  printf(M2);
  printf("\n");
  AES_CBC_ENC(T64, key2, M2, sizeof(M2), M2_ENC, sizeof(M2_ENC));
  memset(M2, 0, sizeof(M2));
  AES_CBC_DEC(T64, key2, M2_ENC, sizeof(M2_ENC), M2, sizeof(M2));
  printf(M2);
  for (int i = 0; i < sizeof(dst_str) - 1; i++) {
    src_str[i] = '0' + i;
    memset(dst_str, 0, sizeof(dst_str));
    int src_size = i + 1;
    int dst_size =
        AES_CBC_ENC(T64, key2, src_str, src_size, dst_str, sizeof(dst_str));
    memset(decyph_str, 0, sizeof(decyph_str));
    int decyph_size = AES_CBC_DEC(T64, key2, dst_str, dst_size, decyph_str,
                                  sizeof(decyph_str));
    printf("\nS:");
    printf(src_str);
    printf("\nD:");
    printf(decyph_str);
    printf("\nC: ");
    print_hex("   ", dst_str, dst_size);
    printf("\n");
    int test = (strlen(decyph_str) == strlen(src_str) &&
                strcmp(decyph_str, src_str) == 0);
    printf("\nTEST: %d", test);
    printf("\n");
    if (test == 0) {
      printf("\ntest fail!\n");
      break;
    }
  }
  printf("\n");
  printf("--------------------------------------------------\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x240,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xe37(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe34(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xe5d(%rip),%rsi
mov    $0x40,%edx
call   1090 <memcpy@plt>
mov    0xe1c(%rip),%rax
mov    %rax,-0x80(%rbp)
mov    0xe19(%rip),%rax
mov    %rax,-0x78(%rbp)
mov    0xe16(%rip),%rax
mov    %rax,-0x90(%rbp)
mov    0xe10(%rip),%rax
mov    %rax,-0x88(%rbp)
mov    0xe5a(%rip),%rax
mov    %rax,-0xb0(%rbp)
mov    0xe54(%rip),%rax
mov    %rax,-0xa8(%rbp)
mov    0xe4f(%rip),%eax
mov    %eax,-0xa0(%rbp)
mov    0xde2(%rip),%rax
mov    %rax,-0xf0(%rbp)
mov    0xddc(%rip),%rax
mov    %rax,-0xe8(%rbp)
lea    -0x150(%rbp),%rdi
xor    %esi,%esi
mov    $0x51,%edx
call   1060 <memset@plt>
lea    -0x1b0(%rbp),%rdi
xor    %esi,%esi
mov    $0x51,%edx
call   1060 <memset@plt>
lea    -0x210(%rbp),%rdi
xor    %esi,%esi
mov    $0x51,%edx
call   1060 <memset@plt>
lea    0xdf1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe17(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x80(%rbp),%rdi
mov    $0x0,%al
call   1030 <print128@plt>
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe00(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x80(%rbp),%rdi
lea    -0x70(%rbp),%rsi
lea    -0x20(%rbp),%rcx
xor    %edx,%edx
mov    $0x0,%al
call   10d0 <AES_CMAC@plt>
lea    0xdf6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1030 <print128@plt>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xddf(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xda1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xdd5(%rip),%rdi
mov    $0x10,%edx
mov    $0x0,%al
call   10a0 <print_hex@plt>
lea    -0x80(%rbp),%rdi
lea    -0x70(%rbp),%rsi
lea    -0x20(%rbp),%rcx
mov    $0x10,%edx
mov    $0x0,%al
call   10d0 <AES_CMAC@plt>
lea    0xd84(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1030 <print128@plt>
lea    0xe0d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd94(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd2f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xd64(%rip),%rdi
mov    $0x28,%edx
mov    $0x0,%al
call   10a0 <print_hex@plt>
lea    -0x80(%rbp),%rdi
lea    -0x70(%rbp),%rsi
lea    -0x20(%rbp),%rcx
mov    $0x28,%edx
mov    $0x0,%al
call   10d0 <AES_CMAC@plt>
lea    0xd12(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1030 <print128@plt>
lea    0xd9b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd38(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xcbd(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xcf2(%rip),%rdi
mov    $0x40,%edx
mov    $0x0,%al
call   10a0 <print_hex@plt>
lea    -0x80(%rbp),%rdi
lea    -0x70(%rbp),%rsi
lea    -0x20(%rbp),%rcx
mov    $0x40,%edx
mov    $0x0,%al
call   10d0 <AES_CMAC@plt>
lea    0xca0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1030 <print128@plt>
lea    0xd29(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x80(%rbp),%rdi
lea    -0x70(%rbp),%rsi
lea    -0x30(%rbp),%rcx
mov    $0x40,%edx
mov    $0x0,%al
call   1070 <AES_CMAC_CHECK@plt>
mov    %eax,%esi
lea    0xcc2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x13,-0x214(%rbp)
lea    -0x90(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
mov    -0x214(%rbp),%edx
lea    -0x20(%rbp),%rcx
mov    $0x0,%al
call   10d0 <AES_CMAC@plt>
mov    -0x214(%rbp),%esi
lea    0xc99(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xc14(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1030 <print128@plt>
lea    0xc9d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x90(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
mov    -0x214(%rbp),%edx
lea    -0xf0(%rbp),%rcx
mov    $0x0,%al
call   1070 <AES_CMAC_CHECK@plt>
mov    %eax,%esi
lea    0xc2c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0xb0(%rbp),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xc4f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x30(%rbp),%rdi
lea    -0x90(%rbp),%rsi
lea    -0xb0(%rbp),%rdx
lea    -0xe0(%rbp),%r8
mov    $0x14,%ecx
mov    $0x30,%r9d
mov    $0x0,%al
call   10b0 <AES_CBC_ENC@plt>
lea    -0xb0(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1060 <memset@plt>
lea    -0x30(%rbp),%rdi
lea    -0x90(%rbp),%rsi
lea    -0xe0(%rbp),%rdx
lea    -0xb0(%rbp),%r8
mov    $0x30,%ecx
mov    $0x14,%r9d
mov    $0x0,%al
call   10c0 <AES_CBC_DEC@plt>
lea    -0xb0(%rbp),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x218(%rbp)
movslq -0x218(%rbp),%rax
cmp    $0x50,%rax
jae    17df <main+0x62f>
mov    -0x218(%rbp),%eax
add    $0x30,%eax
mov    %al,%cl
movslq -0x218(%rbp),%rax
mov    %cl,-0x150(%rbp,%rax,1)
lea    -0x1b0(%rbp),%rdi
xor    %esi,%esi
mov    $0x51,%edx
call   1060 <memset@plt>
mov    -0x218(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x21c(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x90(%rbp),%rsi
lea    -0x150(%rbp),%rdx
mov    -0x21c(%rbp),%ecx
lea    -0x1b0(%rbp),%r8
mov    $0x51,%r9d
mov    $0x0,%al
call   10b0 <AES_CBC_ENC@plt>
mov    %eax,-0x220(%rbp)
lea    -0x210(%rbp),%rdi
xor    %esi,%esi
mov    $0x51,%edx
call   1060 <memset@plt>
lea    -0x30(%rbp),%rdi
lea    -0x90(%rbp),%rsi
lea    -0x1b0(%rbp),%rdx
mov    -0x220(%rbp),%ecx
lea    -0x210(%rbp),%r8
mov    $0x51,%r9d
mov    $0x0,%al
call   10c0 <AES_CBC_DEC@plt>
mov    %eax,-0x224(%rbp)
lea    0xadb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x150(%rbp),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xac3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x210(%rbp),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xaab(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x1b0(%rbp),%rsi
mov    -0x220(%rbp),%edx
lea    0xa3b(%rip),%rdi
mov    $0x0,%al
call   10a0 <print_hex@plt>
lea    0xa9c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x210(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x238(%rbp)
lea    -0x150(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x238(%rbp),%rcx
mov    %rax,%rdx
xor    %eax,%eax
cmp    %rdx,%rcx
mov    %al,-0x229(%rbp)
jne    1773 <main+0x5c3>
lea    -0x210(%rbp),%rdi
lea    -0x150(%rbp),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
sete   %al
mov    %al,-0x229(%rbp)
mov    -0x229(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x228(%rbp)
mov    -0x228(%rbp),%esi
lea    0xa09(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xa10(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
cmpl   $0x0,-0x228(%rbp)
jne    17c6 <main+0x616>
lea    0x9ea(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    17df <main+0x62f>
jmp    17cb <main+0x61b>
mov    -0x218(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x218(%rbp)
jmp    15e8 <main+0x438>
lea    0x9c9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0x8a0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x240,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x208,%rsp
movaps 0xe48(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeac(%rip),%xmm0
movaps %xmm0,0x1b0(%rsp)
movaps 0xe8d(%rip),%xmm0
movaps %xmm0,0x1a0(%rsp)
movaps 0xe6e(%rip),%xmm0
movaps %xmm0,0x190(%rsp)
movaps 0xe4f(%rip),%xmm0
movaps %xmm0,0x180(%rsp)
movaps 0xe10(%rip),%xmm0
movaps %xmm0,0x170(%rsp)
movaps 0xe11(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe65(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x333435,0x10(%rsp)
movaps 0xe02(%rip),%xmm0
movaps %xmm0,0x160(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x140(%rsp)
movaps %xmm0,0x130(%rsp)
movaps %xmm0,0x120(%rsp)
movaps %xmm0,0x110(%rsp)
movaps %xmm0,0x100(%rsp)
movb   $0x0,0x150(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movb   $0x0,0xf0(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movb   $0x0,0x90(%rsp)
lea    0xea7(%rip),%rdi
call   1050 <puts@plt>
lea    0xdc4(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x170(%rsp),%r13
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <print128@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe0f(%rip),%rdi
call   1050 <puts@plt>
lea    0xd9e(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xe06(%rip),%rdi
call   1050 <puts@plt>
lea    0x180(%rsp),%rbx
lea    0x1c0(%rsp),%r15
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %edx,%edx
mov    %r15,%rcx
xor    %eax,%eax
call   10d0 <AES_CMAC@plt>
lea    0xd6f(%rip),%r12
mov    %r12,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <print128@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xdc2(%rip),%rdi
call   1050 <puts@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xd44(%rip),%rdi
mov    %rbx,%rsi
mov    $0x10,%edx
xor    %eax,%eax
call   10a0 <print_hex@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
mov    $0x10,%edx
mov    %r15,%rcx
xor    %eax,%eax
call   10d0 <AES_CMAC@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <print128@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd78(%rip),%rdi
call   1050 <puts@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xce6(%rip),%rbp
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x28,%edx
xor    %eax,%eax
call   10a0 <print_hex@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
mov    $0x28,%edx
mov    %r15,%rcx
xor    %eax,%eax
call   10d0 <AES_CMAC@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <print128@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd2b(%rip),%rdi
call   1050 <puts@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x40,%edx
xor    %eax,%eax
call   10a0 <print_hex@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
mov    $0x40,%edx
mov    %r15,%rcx
xor    %eax,%eax
call   10d0 <AES_CMAC@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <print128@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x30(%rsp),%r14
mov    %r13,%rdi
mov    %rbx,%rsi
mov    $0x40,%edx
mov    %r14,%rcx
xor    %eax,%eax
call   1080 <AES_CMAC_CHECK@plt>
lea    0xc35(%rip),%rbp
mov    %rbp,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x20(%rsp),%r13
mov    %rsp,%rbx
mov    %r13,%rdi
mov    %rbx,%rsi
mov    $0x13,%edx
mov    %r15,%rcx
xor    %eax,%eax
call   10d0 <AES_CMAC@plt>
lea    0xc19(%rip),%rdi
mov    $0x13,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <print128@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x160(%rsp),%rcx
mov    %r13,%rdi
mov    %rbx,%rsi
mov    $0x13,%edx
xor    %eax,%eax
call   1080 <AES_CMAC_CHECK@plt>
mov    %rbp,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1d0(%rsp),%rbp
mov    $0x14,%ecx
mov    $0x30,%r9d
mov    %r14,%rdi
mov    %r13,%rsi
mov    %rbx,%rdx
mov    %rbp,%r8
xor    %eax,%eax
call   10b0 <AES_CBC_ENC@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x10(%rsp)
mov    $0x30,%ecx
mov    $0x14,%r9d
mov    %r14,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
mov    %rbx,%r8
xor    %eax,%eax
call   10c0 <AES_CBC_DEC@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0xffffffffffffffb0,%r14
jmp    15da <main+0x42a>
nopw   0x0(%rax,%rax,1)
movzbl %al,%ebp
lea    0xb55(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r14
test   %bpl,%bpl
je     1741 <main+0x591>
test   %r14,%r14
je     174d <main+0x59d>
lea    -0x80(%r14),%eax
mov    %al,0x150(%rsp,%r14,1)
xorps  %xmm0,%xmm0
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xe0(%rsp)
movb   $0x0,0xf0(%rsp)
lea    0x51(%r14),%ecx
mov    $0x51,%r9d
lea    0x30(%rsp),%r15
mov    %r15,%rdi
lea    0x20(%rsp),%r12
mov    %r12,%rsi
lea    0x100(%rsp),%rdx
lea    0xa0(%rsp),%r13
mov    %r13,%r8
xor    %eax,%eax
call   10b0 <AES_CBC_ENC@plt>
mov    %eax,%ebp
xorps  %xmm0,%xmm0
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x80(%rsp)
movb   $0x0,0x90(%rsp)
mov    $0x51,%r9d
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %eax,%ecx
lea    0x40(%rsp),%rbx
mov    %rbx,%r8
xor    %eax,%eax
call   10c0 <AES_CBC_DEC@plt>
lea    0xa5c(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x100(%rsp),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xa43(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xa2f(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x9f8(%rip),%rdi
mov    %r13,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   10a0 <print_hex@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %rax,%rbp
lea    0x100(%rsp),%rdi
call   1060 <strlen@plt>
cmp    %rax,%rbp
mov    $0x0,%eax
jne    15b0 <main+0x400>
lea    0x40(%rsp),%rdi
lea    0x100(%rsp),%rsi
call   1090 <strcmp@plt>
test   %eax,%eax
sete   %al
jmp    15b0 <main+0x400>
lea    0xa66(%rip),%rdi
call   1050 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xa1d(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
add    $0x208,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.T64 = [16 x i8] c"Q\F0\BE\BF~;\9D\92\FCIt\17y6<\FE"
@__const.main.M = [64 x i8] c"k\C1\BE\E2.@\9F\96\E9=~\11s\93\17*\AE-\8AW\1E\03\AC\9C\9E\B7o\ACE\AF\8EQ0\C8\1CF\A3\\\E4\11\E5\FB\C1\19\1A\0AR\EF\F6\9F$E\DFO\9B\17\AD+A{\E6l7\10"
@__const.main.key = [16 x i8] c"+~\15\16(\AE\D2\A6\AB\F7\15\88\09\CFO<"
@__const.main.key2 = [16 x i8] c"password\00\00\00\00\00\00\00\00"
@__const.main.M2 = [20 x i8] c"1234567890;09876543\00"
@__const.main.T2 = [16 x i8] c"\EF\F2-:x{\D8\A5+\D4~\D5\87\D9\B0\D6"
@.str = [52 x i8] c"--------------------------------------------------\0A\00"
@.str.1 = [16 x i8] c"K \00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [21 x i8] c"\0AExample 1: len = 0\0A\00"
@.str.4 = [16 x i8] c"M \00"
@.str.5 = [16 x i8] c"<empty string>\0A\00"
@.str.6 = [16 x i8] c"AES_CMAC \00"
@.str.7 = [22 x i8] c"\0AExample 2: len = 16\0A\00"
@.str.8 = [17 x i8] c" \00"
@.str.9 = [22 x i8] c"\0AExample 3: len = 40\0A\00"
@.str.10 = [16 x i8] c" \00"
@.str.11 = [22 x i8] c"\0AExample 4: len = 64\0A\00"
@.str.12 = [20 x i8] c"AES_CMAC_CHECK: %d\0A\00"
@.str.13 = [9 x i8] c"M2sz:%d\0A\00"
@.str.14 = [4 x i8] c"\0AS:\00"
@.str.15 = [4 x i8] c"\0AD:\00"
@.str.16 = [5 x i8] c"\0AC: \00"
@.str.17 = [4 x i8] c" \00"
@.str.18 = [10 x i8] c"\0ATEST: %d\00"
@.str.19 = [13 x i8] c"\0Atest fail!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x i8]
%3 = alloca [16 x i8]
%4 = alloca [64 x i8]
%5 = alloca [16 x i8]
%6 = alloca [16 x i8]
%7 = alloca [20 x i8]
%8 = alloca [48 x i8]
%9 = alloca [16 x i8]
%10 = alloca [81 x i8]
%11 = alloca [81 x i8]
%12 = alloca [81 x i8]
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
store i32 0, i32* %1
%19 = bitcast [16 x i8]* %3 to i8*
%20 = bitcast [64 x i8]* %4 to i8*
%21 = bitcast [16 x i8]* %5 to i8*
%22 = bitcast [16 x i8]* %6 to i8*
%23 = bitcast [20 x i8]* %7 to i8*
%24 = bitcast [16 x i8]* %9 to i8*
%25 = bitcast [81 x i8]* %10 to i8*
%26 = bitcast [81 x i8]* %11 to i8*
%27 = bitcast [81 x i8]* %12 to i8*
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%30 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%31 = call i32 (i8*, ...) bitcast (i32 (...)* @print128 to i32 (i8*, ...)*)(i8* %30)
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
%36 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%37 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%38 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%39 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @AES_CMAC to i32 (i8*, i8*, i32, i8*, ...)*)(i8* %36, i8* %37, i32 0, i8* %38)
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
%41 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%42 = call i32 (i8*, ...) bitcast (i32 (...)* @print128 to i32 (i8*, ...)*)(i8* %41)
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0))
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%46 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%47 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @print_hex to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0), i8* %46, i32 16)
%48 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%49 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%50 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%51 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @AES_CMAC to i32 (i8*, i8*, i32, i8*, ...)*)(i8* %48, i8* %49, i32 16, i8* %50)
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
%53 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%54 = call i32 (i8*, ...) bitcast (i32 (...)* @print128 to i32 (i8*, ...)*)(i8* %53)
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0))
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%58 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%59 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @print_hex to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i8* %58, i32 40)
%60 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%61 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%62 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%63 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @AES_CMAC to i32 (i8*, i8*, i32, i8*, ...)*)(i8* %60, i8* %61, i32 40, i8* %62)
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
%65 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%66 = call i32 (i8*, ...) bitcast (i32 (...)* @print128 to i32 (i8*, ...)*)(i8* %65)
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0))
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%70 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%71 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @print_hex to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i8* %70, i32 64)
%72 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%73 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%74 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%75 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @AES_CMAC to i32 (i8*, i8*, i32, i8*, ...)*)(i8* %72, i8* %73, i32 64, i8* %74)
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
%77 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%78 = call i32 (i8*, ...) bitcast (i32 (...)* @print128 to i32 (i8*, ...)*)(i8* %77)
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%80 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%81 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%82 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%83 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @AES_CMAC_CHECK to i32 (i8*, i8*, i32, i8*, ...)*)(i8* %80, i8* %81, i32 64, i8* %82)
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0), i32 %83)
store i32 19, i32* %13
%85 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%86 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%87 = load i32, i32* %13
%88 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%89 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @AES_CMAC to i32 (i8*, i8*, i32, i8*, ...)*)(i8* %85, i8* %86, i32 %87, i8* %88)
%90 = load i32, i32* %13
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0), i32 %90)
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
%93 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%94 = call i32 (i8*, ...) bitcast (i32 (...)* @print128 to i32 (i8*, ...)*)(i8* %93)
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%96 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%97 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%98 = load i32, i32* %13
%99 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%100 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @AES_CMAC_CHECK to i32 (i8*, i8*, i32, i8*, ...)*)(i8* %96, i8* %97, i32 %98, i8* %99)
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0), i32 %100)
%102 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%103 = call i32 (i8*, ...) @printf(i8* %102)
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%105 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%106 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%107 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%108 = getelementptr inbounds [48 x i8], [48 x i8]* %8, i64 0, i64 0
%109 = call i32 (i8*, i8*, i8*, i64, i8*, i64, ...) bitcast (i32 (...)* @AES_CBC_ENC to i32 (i8*, i8*, i8*, i64, i8*, i64, ...)*)(i8* %105, i8* %106, i8* %107, i64 20, i8* %108, i64 48)
%110 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%111 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%112 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%113 = getelementptr inbounds [48 x i8], [48 x i8]* %8, i64 0, i64 0
%114 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%115 = call i32 (i8*, i8*, i8*, i64, i8*, i64, ...) bitcast (i32 (...)* @AES_CBC_DEC to i32 (i8*, i8*, i8*, i64, i8*, i64, ...)*)(i8* %111, i8* %112, i8* %113, i64 48, i8* %114, i64 20)
%116 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%117 = call i32 (i8*, ...) @printf(i8* %116)
store i32 0, i32* %14
br label %118
118: ; preds = %177, %0
%119 = load i32, i32* %14
%120 = sext i32 %119 to i64
%121 = icmp ult i64 %120, 80
br i1 %121, label %122, label %180
122: ; preds = %118
%123 = load i32, i32* %14
%124 = add nsw i32 48, %123
%125 = trunc i32 %124 to i8
%126 = load i32, i32* %14
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds [81 x i8], [81 x i8]* %10, i64 0, i64 %127
store i8 %125, i8* %128
%129 = getelementptr inbounds [81 x i8], [81 x i8]* %11, i64 0, i64 0
%130 = load i32, i32* %14
%131 = add nsw i32 %130, 1
store i32 %131, i32* %15
%132 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%133 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%134 = getelementptr inbounds [81 x i8], [81 x i8]* %10, i64 0, i64 0
%135 = load i32, i32* %15
%136 = getelementptr inbounds [81 x i8], [81 x i8]* %11, i64 0, i64 0
%137 = call i32 (i8*, i8*, i8*, i32, i8*, i64, ...) bitcast (i32 (...)* @AES_CBC_ENC to i32 (i8*, i8*, i8*, i32, i8*, i64, ...)*)(i8* %132, i8* %133, i8* %134, i32 %135, i8* %136, i64 81)
store i32 %137, i32* %16
%138 = getelementptr inbounds [81 x i8], [81 x i8]* %12, i64 0, i64 0
%139 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%140 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%141 = getelementptr inbounds [81 x i8], [81 x i8]* %11, i64 0, i64 0
%142 = load i32, i32* %16
%143 = getelementptr inbounds [81 x i8], [81 x i8]* %12, i64 0, i64 0
%144 = call i32 (i8*, i8*, i8*, i32, i8*, i64, ...) bitcast (i32 (...)* @AES_CBC_DEC to i32 (i8*, i8*, i8*, i32, i8*, i64, ...)*)(i8* %139, i8* %140, i8* %141, i32 %142, i8* %143, i64 81)
store i32 %144, i32* %17
%145 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
%146 = getelementptr inbounds [81 x i8], [81 x i8]* %10, i64 0, i64 0
%147 = call i32 (i8*, ...) @printf(i8* %146)
%148 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0))
%149 = getelementptr inbounds [81 x i8], [81 x i8]* %12, i64 0, i64 0
%150 = call i32 (i8*, ...) @printf(i8* %149)
%151 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i64 0, i64 0))
%152 = getelementptr inbounds [81 x i8], [81 x i8]* %11, i64 0, i64 0
%153 = load i32, i32* %16
%154 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @print_hex to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), i8* %152, i32 %153)
%155 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%156 = getelementptr inbounds [81 x i8], [81 x i8]* %12, i64 0, i64 0
%157 = call i64 @strlen(i8* %156)
%158 = getelementptr inbounds [81 x i8], [81 x i8]* %10, i64 0, i64 0
%159 = call i64 @strlen(i8* %158)
%160 = icmp eq i64 %157, %159
br i1 %160, label %161, label %166
161: ; preds = %122
%162 = getelementptr inbounds [81 x i8], [81 x i8]* %12, i64 0, i64 0
%163 = getelementptr inbounds [81 x i8], [81 x i8]* %10, i64 0, i64 0
%164 = call i32 @strcmp(i8* %162, i8* %163)
%165 = icmp eq i32 %164, 0
br label %166
166: ; preds = %161, %122
%167 = phi i1 [ false, %122 ], [ %165, %161 ]
%168 = zext i1 %167 to i32
store i32 %168, i32* %18
%169 = load i32, i32* %18
%170 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i64 0, i64 0), i32 %169)
%171 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%172 = load i32, i32* %18
%173 = icmp eq i32 %172, 0
br i1 %173, label %174, label %176
174: ; preds = %166
%175 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.19, i64 0, i64 0))
br label %180
176: ; preds = %166
br label %177
177: ; preds = %176
%178 = load i32, i32* %14
%179 = add nsw i32 %178, 1
store i32 %179, i32* %14
br label %118
180: ; preds = %174, %118
%181 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%182 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.T64 = [16 x i8] c"Q\F0\BE\BF~;\9D\92\FCIt\17y6<\FE"
@__const.main.M = [64 x i8] c"k\C1\BE\E2.@\9F\96\E9=~\11s\93\17*\AE-\8AW\1E\03\AC\9C\9E\B7o\ACE\AF\8EQ0\C8\1CF\A3\\\E4\11\E5\FB\C1\19\1A\0AR\EF\F6\9F$E\DFO\9B\17\AD+A{\E6l7\10"
@__const.main.key = [16 x i8] c"+~\15\16(\AE\D2\A6\AB\F7\15\88\09\CFO<"
@__const.main.key2 = [16 x i8] c"password\00\00\00\00\00\00\00\00"
@__const.main.M2 = [20 x i8] c"1234567890;09876543\00"
@__const.main.T2 = [16 x i8] c"\EF\F2-:x{\D8\A5+\D4~\D5\87\D9\B0\D6"
@.str.1 = [16 x i8] c"K \00"
@.str.4 = [16 x i8] c"M \00"
@.str.6 = [16 x i8] c"AES_CMAC \00"
@.str.8 = [17 x i8] c" \00"
@.str.10 = [16 x i8] c" \00"
@.str.12 = [20 x i8] c"AES_CMAC_CHECK: %d\0A\00"
@.str.13 = [9 x i8] c"M2sz:%d\0A\00"
@.str.14 = [4 x i8] c"\0AS:\00"
@.str.15 = [4 x i8] c"\0AD:\00"
@.str.16 = [5 x i8] c"\0AC: \00"
@.str.17 = [4 x i8] c" \00"
@.str.18 = [10 x i8] c"\0ATEST: %d\00"
@str.20 = [20 x i8] c"\0AExample 1: len = 0\00"
@str.21 = [15 x i8] c"<empty string>\00"
@str.22 = [21 x i8] c"\0AExample 2: len = 16\00"
@str.23 = [21 x i8] c"\0AExample 3: len = 40\00"
@str.24 = [21 x i8] c"\0AExample 4: len = 64\00"
@str.25 = [51 x i8] c"--------------------------------------------------\00"
@str.26 = [12 x i8] c"\0Atest fail!\00"
define i32 @main() {
%1 = alloca [16 x i8]
%2 = alloca [16 x i8]
%3 = alloca [64 x i8]
%4 = alloca [16 x i8]
%5 = alloca [16 x i8]
%6 = alloca [20 x i8]
%7 = alloca [48 x i8]
%8 = alloca [16 x i8]
%9 = alloca [81 x i8]
%10 = alloca [81 x i8]
%11 = alloca [81 x i8]
%12 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%13 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%14 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%15 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%16 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%17 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%18 = getelementptr inbounds [48 x i8], [48 x i8]* %7, i64 0, i64 0
%19 = getelementptr inbounds [16 x i8], [16 x i8]* %8, i64 0, i64 0
%20 = getelementptr inbounds [81 x i8], [81 x i8]* %9, i64 0, i64 0
%21 = getelementptr inbounds [81 x i8], [81 x i8]* %10, i64 0, i64 0
%22 = getelementptr inbounds [81 x i8], [81 x i8]* %11, i64 0, i64 0
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.25, i64 0, i64 0))
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%25 = call i32 (i8*, ...) bitcast (i32 (...)* @print128 to i32 (i8*, ...)*)(i8* %15)
%26 = call i32 @putchar(i32 10)
%27 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.20, i64 0, i64 0))
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%29 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.21, i64 0, i64 0))
%30 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @AES_CMAC to i32 (i8*, i8*, i32, i8*, ...)*)(i8* %15, i8* %14, i32 0, i8* %12)
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
%32 = call i32 (i8*, ...) bitcast (i32 (...)* @print128 to i32 (i8*, ...)*)(i8* %12)
%33 = call i32 @putchar(i32 10)
%34 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.22, i64 0, i64 0))
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%36 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @print_hex to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0), i8* %14, i32 16)
%37 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @AES_CMAC to i32 (i8*, i8*, i32, i8*, ...)*)(i8* %15, i8* %14, i32 16, i8* %12)
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
%39 = call i32 (i8*, ...) bitcast (i32 (...)* @print128 to i32 (i8*, ...)*)(i8* %12)
%40 = call i32 @putchar(i32 10)
%41 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.23, i64 0, i64 0))
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%43 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @print_hex to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i8* %14, i32 40)
%44 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @AES_CMAC to i32 (i8*, i8*, i32, i8*, ...)*)(i8* %15, i8* %14, i32 40, i8* %12)
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
%46 = call i32 (i8*, ...) bitcast (i32 (...)* @print128 to i32 (i8*, ...)*)(i8* %12)
%47 = call i32 @putchar(i32 10)
%48 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.24, i64 0, i64 0))
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%50 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @print_hex to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i8* %14, i32 64)
%51 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @AES_CMAC to i32 (i8*, i8*, i32, i8*, ...)*)(i8* %15, i8* %14, i32 64, i8* %12)
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
%53 = call i32 (i8*, ...) bitcast (i32 (...)* @print128 to i32 (i8*, ...)*)(i8* %12)
%54 = call i32 @putchar(i32 10)
%55 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @AES_CMAC_CHECK to i32 (i8*, i8*, i32, i8*, ...)*)(i8* %15, i8* %14, i32 64, i8* %13)
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0), i32 %55)
%57 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @AES_CMAC to i32 (i8*, i8*, i32, i8*, ...)*)(i8* %16, i8* %17, i32 19, i8* %12)
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0), i32 19)
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
%60 = call i32 (i8*, ...) bitcast (i32 (...)* @print128 to i32 (i8*, ...)*)(i8* %12)
%61 = call i32 @putchar(i32 10)
%62 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @AES_CMAC_CHECK to i32 (i8*, i8*, i32, i8*, ...)*)(i8* %16, i8* %17, i32 19, i8* %19)
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0), i32 %62)
%64 = call i32 (i8*, ...) @printf(i8* %17)
%65 = call i32 @putchar(i32 10)
%66 = call i32 (i8*, i8*, i8*, i64, i8*, i64, ...) bitcast (i32 (...)* @AES_CBC_ENC to i32 (i8*, i8*, i8*, i64, i8*, i64, ...)*)(i8* %13, i8* %16, i8* %17, i64 20, i8* %18, i64 48)
%67 = call i32 (i8*, i8*, i8*, i64, i8*, i64, ...) bitcast (i32 (...)* @AES_CBC_DEC to i32 (i8*, i8*, i8*, i64, i8*, i64, ...)*)(i8* %13, i8* %16, i8* %18, i64 48, i8* %17, i64 20)
%68 = call i32 (i8*, ...) @printf(i8* %17)
br label %69
69: ; preds = %93, %0
%70 = phi i64 [ %76, %93 ], [ 0, %0 ]
%71 = icmp eq i64 %70, 80
br i1 %71, label %100, label %72
72: ; preds = %69
%73 = trunc i64 %70 to i8
%74 = add nuw nsw i8 %73, 48
%75 = getelementptr inbounds [81 x i8], [81 x i8]* %9, i64 0, i64 %70
store i8 %74, i8* %75
%76 = add nuw nsw i64 %70, 1
%77 = trunc i64 %76 to i32
%78 = call i32 (i8*, i8*, i8*, i32, i8*, i64, ...) bitcast (i32 (...)* @AES_CBC_ENC to i32 (i8*, i8*, i8*, i32, i8*, i64, ...)*)(i8* %13, i8* %16, i8* %20, i32 %77, i8* %21, i64 81)
%79 = call i32 (i8*, i8*, i8*, i32, i8*, i64, ...) bitcast (i32 (...)* @AES_CBC_DEC to i32 (i8*, i8*, i8*, i32, i8*, i64, ...)*)(i8* %13, i8* %16, i8* %21, i32 %78, i8* %22, i64 81)
%80 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
%81 = call i32 (i8*, ...) @printf(i8* %20)
%82 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0))
%83 = call i32 (i8*, ...) @printf(i8* %22)
%84 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i64 0, i64 0))
%85 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @print_hex to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), i8* %21, i32 %78)
%86 = call i32 @putchar(i32 10)
%87 = call i64 @strlen(i8* %22)
%88 = call i64 @strlen(i8* %20)
%89 = icmp eq i64 %87, %88
br i1 %89, label %90, label %93
90: ; preds = %72
%91 = call i32 @strcmp(i8* %22, i8* %20)
%92 = icmp eq i32 %91, 0
br label %93
93: ; preds = %90, %72
%94 = phi i1 [ false, %72 ], [ %92, %90 ]
%95 = zext i1 %94 to i32
%96 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i64 0, i64 0), i32 %95)
%97 = call i32 @putchar(i32 10)
br i1 %94, label %69, label %98
98: ; preds = %93
%99 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.26, i64 0, i64 0))
br label %100
100: ; preds = %69, %98
%101 = call i32 @putchar(i32 10)
%102 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.25, i64 0, i64 0))
ret i32 0
}