#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 */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ block_src;
typedef int /*<<< orphan*/ block_dest;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int fread(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
scalar_t__ memcmp(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
void AES_Verify(FILE *src_file, FILE *dest_file) {
  int read_count_src;
  int read_count_dest;
  uint8_t block_src[16];
  uint8_t block_dest[16];
  read_count_src =
      fread(block_src, sizeof(uint8_t), sizeof(block_src), src_file);
  read_count_dest =
      fread(block_dest, sizeof(uint8_t), sizeof(block_dest), dest_file);
  while (read_count_src > 0) {
    if (read_count_src == read_count_dest) {
      if (memcmp(block_src, block_dest, read_count_src) != 0) {
        fprintf(stderr, "\x1B[31m"
                        "Verification FAIL!\n");
        exit(EXIT_FAILURE);
      }
      read_count_src =
          fread(block_src, sizeof(uint8_t), sizeof(block_src), src_file);
      read_count_dest =
          fread(block_dest, sizeof(uint8_t), sizeof(block_dest), dest_file);
    } else {
      fprintf(stderr, "\x1B[31m"
                      "Verification FAIL!\n");
      exit(EXIT_FAILURE);
    }
  }
  printf("\x1B[32m"
         "Verification SUCCESS!\n");
}


x86 assembly (clang, -O0):
<AES_Verify>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x4,%esi
mov    $0x40,%edx
call   1030 <fread@plt>
mov    %eax,-0x14(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x4,%esi
mov    $0x40,%edx
call   1030 <fread@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1254 <AES_Verify+0x104>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    122c <AES_Verify+0xdc>
lea    -0x60(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <memcmp@plt>
cmp    $0x0,%rax
je     11f0 <AES_Verify+0xa0>
mov    0x2e0c(%rip),%rax
mov    (%rax),%edi
lea    0xe23(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2def(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x4,%esi
mov    $0x40,%edx
call   1030 <fread@plt>
mov    %eax,-0x14(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x4,%esi
mov    $0x40,%edx
call   1030 <fread@plt>
mov    %eax,-0x18(%rbp)
jmp    124f <AES_Verify+0xff>
mov    0x2dad(%rip),%rax
mov    (%rax),%edi
lea    0xdc4(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2d90(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
jmp    119a <AES_Verify+0x4a>
lea    0xdbe(%rip),%rdi
call   1040 <printf@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AES_Verify>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x80,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x40(%rsp),%rdi
mov    $0x4,%esi
mov    $0x40,%edx
mov    %r15,%rcx
call   1040 <fread@plt>
mov    %eax,%ebp
mov    %rsp,%rdi
mov    $0x4,%esi
mov    $0x40,%edx
mov    %r14,%rcx
call   1040 <fread@plt>
test   %ebp,%ebp
jle    11e6 <AES_Verify+0x96>
lea    0x40(%rsp),%r12
mov    %rsp,%rbx
nop
cmp    %eax,%ebp
jne    1202 <AES_Verify+0xb2>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <memcmp@plt>
test   %rax,%rax
jne    1202 <AES_Verify+0xb2>
mov    %r12,%rdi
mov    $0x4,%esi
mov    $0x40,%edx
mov    %r15,%rcx
call   1040 <fread@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x40,%edx
mov    %r14,%rcx
call   1040 <fread@plt>
test   %ebp,%ebp
jg     11a0 <AES_Verify+0x50>
lea    0xe2c(%rip),%rdi
call   1030 <puts@plt>
add    $0x80,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2dd7(%rip),%rax
mov    (%rax),%edi
lea    0xdee(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2dba(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"\1B[31mVerification FAIL!\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [28 x i8] c"\1B[32mVerification SUCCESS!\0A\00"
define void @AES_Verify(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca [16 x i32]
%8 = alloca [16 x i32]
store i32* %0, i32** %3
store i32* %1, i32** %4
%9 = getelementptr inbounds [16 x i32], [16 x i32]* %7, i64 0, i64 0
%10 = load i32*, i32** %3
%11 = call i32 @fread(i32* %9, i32 4, i32 64, i32* %10)
store i32 %11, i32* %5
%12 = getelementptr inbounds [16 x i32], [16 x i32]* %8, i64 0, i64 0
%13 = load i32*, i32** %4
%14 = call i32 @fread(i32* %12, i32 4, i32 64, i32* %13)
store i32 %14, i32* %6
br label %15
15: ; preds = %45, %2
%16 = load i32, i32* %5
%17 = icmp sgt i32 %16, 0
br i1 %17, label %18, label %46
18: ; preds = %15
%19 = load i32, i32* %5
%20 = load i32, i32* %6
%21 = icmp eq i32 %19, %20
br i1 %21, label %22, label %40
22: ; preds = %18
%23 = getelementptr inbounds [16 x i32], [16 x i32]* %7, i64 0, i64 0
%24 = getelementptr inbounds [16 x i32], [16 x i32]* %8, i64 0, i64 0
%25 = load i32, i32* %5
%26 = call i64 @memcmp(i32* %23, i32* %24, i32 %25)
%27 = icmp ne i64 %26, 0
br i1 %27, label %28, label %33
28: ; preds = %22
%29 = load i32, i32* @stderr
%30 = call i32 @fprintf(i32 %29, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%31 = load i32, i32* @EXIT_FAILURE
%32 = call i32 @exit(i32 %31)
unreachable
33: ; preds = %22
%34 = getelementptr inbounds [16 x i32], [16 x i32]* %7, i64 0, i64 0
%35 = load i32*, i32** %3
%36 = call i32 @fread(i32* %34, i32 4, i32 64, i32* %35)
store i32 %36, i32* %5
%37 = getelementptr inbounds [16 x i32], [16 x i32]* %8, i64 0, i64 0
%38 = load i32*, i32** %4
%39 = call i32 @fread(i32* %37, i32 4, i32 64, i32* %38)
store i32 %39, i32* %6
br label %45
40: ; preds = %18
%41 = load i32, i32* @stderr
%42 = call i32 @fprintf(i32 %41, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%43 = load i32, i32* @EXIT_FAILURE
%44 = call i32 @exit(i32 %43)
unreachable
45: ; preds = %33
br label %15
46: ; preds = %15
%47 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"\1B[31mVerification FAIL!\0A\00"
@EXIT_FAILURE = global i32 0
@str = [27 x i8] c"\1B[32mVerification SUCCESS!\00"
define void @AES_Verify(i32* nocapture %0, i32* nocapture %1) {
%3 = alloca [16 x i32]
%4 = alloca [16 x i32]
%5 = bitcast [16 x i32]* %3 to i8*
%6 = bitcast [16 x i32]* %4 to i8*
%7 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 0
%8 = call i32 @fread(i32* %7, i32 4, i32 64, i32* %0)
%9 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 0
%10 = call i32 @fread(i32* %9, i32 4, i32 64, i32* %1)
%11 = icmp sgt i32 %8, 0
br i1 %11, label %12, label %33
12: ; preds = %2, %24
%13 = phi i32 [ %26, %24 ], [ %10, %2 ]
%14 = phi i32 [ %25, %24 ], [ %8, %2 ]
%15 = icmp eq i32 %14, %13
br i1 %15, label %16, label %28
16: ; preds = %12
%17 = call i64 @memcmp(i32* %7, i32* %9, i32 %13)
%18 = icmp eq i64 %17, 0
br i1 %18, label %24, label %19
19: ; preds = %16
%20 = load i32, i32* @stderr
%21 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%22 = load i32, i32* @EXIT_FAILURE
%23 = call i32 @exit(i32 %22)
unreachable
24: ; preds = %16
%25 = call i32 @fread(i32* %7, i32 4, i32 64, i32* %0)
%26 = call i32 @fread(i32* %9, i32 4, i32 64, i32* %1)
%27 = icmp sgt i32 %25, 0
br i1 %27, label %12, label %33
28: ; preds = %12
%29 = load i32, i32* @stderr
%30 = call i32 @fprintf(i32 %29, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%31 = load i32, i32* @EXIT_FAILURE
%32 = call i32 @exit(i32 %31)
unreachable
33: ; preds = %24, %2
%34 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret void
}