#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ print_pmac_test_case(int, char *, char *, char *);
int /*<<< orphan*/ printf(char *);
int print_pmac_test_vectors(void) {
  char z[1000] =
      {
          0,
      },
       key[32], pt[50], ct[1000],
       nonce[16] =
           {
               0,
           },
       tag[16];
  int i;
  nonce[15] = 1;
  for (i = 0; i < 32; i++) {
    key[i] = i;
  }
  for (i = 0; i < 34; i++) {
    pt[i] = i;
  }
  print_pmac_test_case(0, key, pt, tag);
  print_pmac_test_case(3, key, pt, tag);
  print_pmac_test_case(16, key, pt, tag);
  print_pmac_test_case(20, key, pt, tag);
  print_pmac_test_case(32, key, pt, tag);
  print_pmac_test_case(34, key, pt, tag);
  print_pmac_test_case(1000, key, z, tag);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<print_pmac_test_vectors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x870,%rsp
lea    -0x3f0(%rbp),%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   1040 <memset@plt>
lea    -0x850(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
movb   $0x1,-0x841(%rbp)
movl   $0x0,-0x864(%rbp)
cmpl   $0x20,-0x864(%rbp)
jge    11a9 <print_pmac_test_vectors+0x79>
mov    -0x864(%rbp),%eax
mov    %al,%cl
movslq -0x864(%rbp),%rax
mov    %cl,-0x410(%rbp,%rax,1)
mov    -0x864(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x864(%rbp)
jmp    1172 <print_pmac_test_vectors+0x42>
movl   $0x0,-0x864(%rbp)
cmpl   $0x22,-0x864(%rbp)
jge    11ea <print_pmac_test_vectors+0xba>
mov    -0x864(%rbp),%eax
mov    %al,%cl
movslq -0x864(%rbp),%rax
mov    %cl,-0x450(%rbp,%rax,1)
mov    -0x864(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x864(%rbp)
jmp    11b3 <print_pmac_test_vectors+0x83>
lea    -0x410(%rbp),%rsi
lea    -0x450(%rbp),%rdx
lea    -0x860(%rbp),%rcx
xor    %edi,%edi
call   1050 <print_pmac_test_case@plt>
lea    -0x410(%rbp),%rsi
lea    -0x450(%rbp),%rdx
lea    -0x860(%rbp),%rcx
mov    $0x3,%edi
call   1050 <print_pmac_test_case@plt>
lea    -0x410(%rbp),%rsi
lea    -0x450(%rbp),%rdx
lea    -0x860(%rbp),%rcx
mov    $0x10,%edi
call   1050 <print_pmac_test_case@plt>
lea    -0x410(%rbp),%rsi
lea    -0x450(%rbp),%rdx
lea    -0x860(%rbp),%rcx
mov    $0x14,%edi
call   1050 <print_pmac_test_case@plt>
lea    -0x410(%rbp),%rsi
lea    -0x450(%rbp),%rdx
lea    -0x860(%rbp),%rcx
mov    $0x20,%edi
call   1050 <print_pmac_test_case@plt>
lea    -0x410(%rbp),%rsi
lea    -0x450(%rbp),%rdx
lea    -0x860(%rbp),%rcx
mov    $0x22,%edi
call   1050 <print_pmac_test_case@plt>
lea    -0x410(%rbp),%rsi
lea    -0x3f0(%rbp),%rdx
lea    -0x860(%rbp),%rcx
mov    $0x3e8,%edi
call   1050 <print_pmac_test_case@plt>
lea    0xd39(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x870,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_pmac_test_vectors>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x458,%rsp
lea    0x70(%rsp),%r14
mov    $0x3e8,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
movaps 0xea7(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xeac(%rip),%xmm1
movaps %xmm1,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm1,0x30(%rsp)
movw   $0x2120,0x40(%rsp)
mov    %rsp,%rbx
lea    0x20(%rsp),%r12
lea    0x60(%rsp),%r15
xor    %edi,%edi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %r15,%rcx
call   1050 <print_pmac_test_case@plt>
mov    $0x3,%edi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %r15,%rcx
call   1050 <print_pmac_test_case@plt>
mov    $0x10,%edi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %r15,%rcx
call   1050 <print_pmac_test_case@plt>
mov    $0x14,%edi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %r15,%rcx
call   1050 <print_pmac_test_case@plt>
mov    $0x20,%edi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %r15,%rcx
call   1050 <print_pmac_test_case@plt>
mov    $0x22,%edi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %r15,%rcx
call   1050 <print_pmac_test_case@plt>
mov    $0x3e8,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %r15,%rcx
call   1050 <print_pmac_test_case@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x458,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define i32 @print_pmac_test_vectors() {
%1 = alloca [1000 x i8]
%2 = alloca [32 x i8]
%3 = alloca [50 x i8]
%4 = alloca [1000 x i8]
%5 = alloca [16 x i8]
%6 = alloca [16 x i8]
%7 = alloca i32
%8 = bitcast [1000 x i8]* %1 to i8*
%9 = bitcast [16 x i8]* %5 to i8*
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 15
store i8 1, i8* %10
store i32 0, i32* %7
br label %11
11: ; preds = %20, %0
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 32
br i1 %13, label %14, label %23
14: ; preds = %11
%15 = load i32, i32* %7
%16 = trunc i32 %15 to i8
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 %18
store i8 %16, i8* %19
br label %20
20: ; preds = %14
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
store i32 %22, i32* %7
br label %11
23: ; preds = %11
store i32 0, i32* %7
br label %24
24: ; preds = %33, %23
%25 = load i32, i32* %7
%26 = icmp slt i32 %25, 34
br i1 %26, label %27, label %36
27: ; preds = %24
%28 = load i32, i32* %7
%29 = trunc i32 %28 to i8
%30 = load i32, i32* %7
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 %31
store i8 %29, i8* %32
br label %33
33: ; preds = %27
%34 = load i32, i32* %7
%35 = add nsw i32 %34, 1
store i32 %35, i32* %7
br label %24
36: ; preds = %24
%37 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%38 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%39 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%40 = call i32 @print_pmac_test_case(i32 0, i8* %37, i8* %38, i8* %39)
%41 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%42 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%43 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%44 = call i32 @print_pmac_test_case(i32 3, i8* %41, i8* %42, i8* %43)
%45 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%46 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%47 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%48 = call i32 @print_pmac_test_case(i32 16, i8* %45, i8* %46, i8* %47)
%49 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%50 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%51 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%52 = call i32 @print_pmac_test_case(i32 20, i8* %49, i8* %50, i8* %51)
%53 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%54 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%55 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%56 = call i32 @print_pmac_test_case(i32 32, i8* %53, i8* %54, i8* %55)
%57 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%58 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%59 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%60 = call i32 @print_pmac_test_case(i32 34, i8* %57, i8* %58, i8* %59)
%61 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%62 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%63 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%64 = call i32 @print_pmac_test_case(i32 1000, i8* %61, i8* %62, i8* %63)
%65 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
define i32 @print_pmac_test_vectors() {
%1 = alloca [1000 x i8]
%2 = alloca [32 x i8]
%3 = alloca [50 x i8]
%4 = alloca [16 x i8]
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%9 = bitcast [32 x i8]* %2 to <16 x i8>*
store <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, <16 x i8>* %9
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 16
%11 = bitcast i8* %10 to <16 x i8>*
store <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, <16 x i8>* %11
%12 = bitcast [50 x i8]* %3 to <16 x i8>*
store <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, <16 x i8>* %12
%13 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 16
%14 = bitcast i8* %13 to <16 x i8>*
store <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, <16 x i8>* %14
%15 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 32
store i8 32, i8* %15
%16 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 33
store i8 33, i8* %16
%17 = call i32 @print_pmac_test_case(i32 0, i8* %6, i8* %7, i8* %8)
%18 = call i32 @print_pmac_test_case(i32 3, i8* %6, i8* %7, i8* %8)
%19 = call i32 @print_pmac_test_case(i32 16, i8* %6, i8* %7, i8* %8)
%20 = call i32 @print_pmac_test_case(i32 20, i8* %6, i8* %7, i8* %8)
%21 = call i32 @print_pmac_test_case(i32 32, i8* %6, i8* %7, i8* %8)
%22 = call i32 @print_pmac_test_case(i32 34, i8* %6, i8* %7, i8* %8)
%23 = call i32 @print_pmac_test_case(i32 1000, i8* %6, i8* %5, i8* %8)
%24 = call i32 @putchar(i32 10)
ret i32 0
}