#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*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void printStateToFile(unsigned char state[16], FILE *fp) {
  fprintf(fp, "|%02X %02X %02X %02X|\n", state[0], state[4], state[8],
          state[12]);
  fprintf(fp, "|%02X %02X %02X %02X|\n", state[1], state[5], state[9],
          state[13]);
  fprintf(fp, "|%02X %02X %02X %02X|\n", state[2], state[6], state[10],
          state[14]);
  fprintf(fp, "|%02X %02X %02X %02X|\n", state[3], state[7], state[11],
          state[15]);
  fprintf(fp, "------------------------------\n");
}


x86 assembly (clang, -O0):
<printStateToFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
mov    -0x8(%rbp),%rax
movzbl 0x4(%rax),%ecx
mov    -0x8(%rbp),%rax
movzbl 0x8(%rax),%r8d
mov    -0x8(%rbp),%rax
movzbl 0xc(%rax),%r9d
lea    0xeb4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%edx
mov    -0x8(%rbp),%rax
movzbl 0x5(%rax),%ecx
mov    -0x8(%rbp),%rax
movzbl 0x9(%rax),%r8d
mov    -0x8(%rbp),%rax
movzbl 0xd(%rax),%r9d
lea    0xe80(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%edx
mov    -0x8(%rbp),%rax
movzbl 0x6(%rax),%ecx
mov    -0x8(%rbp),%rax
movzbl 0xa(%rax),%r8d
mov    -0x8(%rbp),%rax
movzbl 0xe(%rax),%r9d
lea    0xe4c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%edx
mov    -0x8(%rbp),%rax
movzbl 0x7(%rax),%ecx
mov    -0x8(%rbp),%rax
movzbl 0xb(%rax),%r8d
mov    -0x8(%rbp),%rax
movzbl 0xf(%rax),%r9d
lea    0xe18(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xe1d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printStateToFile>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
movzbl (%rdi),%edx
movzbl 0x4(%rdi),%ecx
movzbl 0x8(%rdi),%r8d
movzbl 0xc(%rdi),%r9d
lea    0xebd(%rip),%r15
mov    %rsi,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
movzbl 0x1(%rbx),%edx
movzbl 0x5(%rbx),%ecx
movzbl 0x9(%rbx),%r8d
movzbl 0xd(%rbx),%r9d
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
movzbl 0x2(%rbx),%edx
movzbl 0x6(%rbx),%ecx
movzbl 0xa(%rbx),%r8d
movzbl 0xe(%rbx),%r9d
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
movzbl 0x3(%rbx),%edx
movzbl 0x7(%rbx),%ecx
movzbl 0xb(%rbx),%r8d
movzbl 0xf(%rbx),%r9d
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xe63(%rip),%rdi
mov    $0x1f,%esi
mov    $0x1,%edx
mov    %r14,%rcx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"|%02X %02X %02X %02X|\0A\00"
@.str.1 = [32 x i8] c"------------------------------\0A\00"
define void @printStateToFile(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 4
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 8
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 12
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %13, i32 %17, i32 %21)
%23 = load i32*, i32** %4
%24 = load i8*, i8** %3
%25 = getelementptr inbounds i8, i8* %24, i64 1
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = load i8*, i8** %3
%29 = getelementptr inbounds i8, i8* %28, i64 5
%30 = load i8, i8* %29
%31 = zext i8 %30 to i32
%32 = load i8*, i8** %3
%33 = getelementptr inbounds i8, i8* %32, i64 9
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
%36 = load i8*, i8** %3
%37 = getelementptr inbounds i8, i8* %36, i64 13
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = call i32 (i32*, i8*, ...) @fprintf(i32* %23, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %27, i32 %31, i32 %35, i32 %39)
%41 = load i32*, i32** %4
%42 = load i8*, i8** %3
%43 = getelementptr inbounds i8, i8* %42, i64 2
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = load i8*, i8** %3
%47 = getelementptr inbounds i8, i8* %46, i64 6
%48 = load i8, i8* %47
%49 = zext i8 %48 to i32
%50 = load i8*, i8** %3
%51 = getelementptr inbounds i8, i8* %50, i64 10
%52 = load i8, i8* %51
%53 = zext i8 %52 to i32
%54 = load i8*, i8** %3
%55 = getelementptr inbounds i8, i8* %54, i64 14
%56 = load i8, i8* %55
%57 = zext i8 %56 to i32
%58 = call i32 (i32*, i8*, ...) @fprintf(i32* %41, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %45, i32 %49, i32 %53, i32 %57)
%59 = load i32*, i32** %4
%60 = load i8*, i8** %3
%61 = getelementptr inbounds i8, i8* %60, i64 3
%62 = load i8, i8* %61
%63 = zext i8 %62 to i32
%64 = load i8*, i8** %3
%65 = getelementptr inbounds i8, i8* %64, i64 7
%66 = load i8, i8* %65
%67 = zext i8 %66 to i32
%68 = load i8*, i8** %3
%69 = getelementptr inbounds i8, i8* %68, i64 11
%70 = load i8, i8* %69
%71 = zext i8 %70 to i32
%72 = load i8*, i8** %3
%73 = getelementptr inbounds i8, i8* %72, i64 15
%74 = load i8, i8* %73
%75 = zext i8 %74 to i32
%76 = call i32 (i32*, i8*, ...) @fprintf(i32* %59, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %63, i32 %67, i32 %71, i32 %75)
%77 = load i32*, i32** %4
%78 = call i32 (i32*, i8*, ...) @fprintf(i32* %77, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"|%02X %02X %02X %02X|\0A\00"
@.str.1 = [32 x i8] c"------------------------------\0A\00"
define void @printStateToFile(i8* nocapture %0, i32* nocapture %1) {
%3 = load i8, i8* %0
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = getelementptr inbounds i8, i8* %0, i64 8
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = getelementptr inbounds i8, i8* %0, i64 12
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %7, i32 %10, i32 %13)
%15 = getelementptr inbounds i8, i8* %0, i64 1
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = getelementptr inbounds i8, i8* %0, i64 5
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = getelementptr inbounds i8, i8* %0, i64 9
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = getelementptr inbounds i8, i8* %0, i64 13
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %20, i32 %23, i32 %26)
%28 = getelementptr inbounds i8, i8* %0, i64 2
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = getelementptr inbounds i8, i8* %0, i64 6
%32 = load i8, i8* %31
%33 = zext i8 %32 to i32
%34 = getelementptr inbounds i8, i8* %0, i64 10
%35 = load i8, i8* %34
%36 = zext i8 %35 to i32
%37 = getelementptr inbounds i8, i8* %0, i64 14
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %30, i32 %33, i32 %36, i32 %39)
%41 = getelementptr inbounds i8, i8* %0, i64 3
%42 = load i8, i8* %41
%43 = zext i8 %42 to i32
%44 = getelementptr inbounds i8, i8* %0, i64 7
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
%47 = getelementptr inbounds i8, i8* %0, i64 11
%48 = load i8, i8* %47
%49 = zext i8 %48 to i32
%50 = getelementptr inbounds i8, i8* %0, i64 15
%51 = load i8, i8* %50
%52 = zext i8 %51 to i32
%53 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %43, i32 %46, i32 %49, i32 %52)
%54 = tail call i64 @fwrite(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i64 31, i64 1, i32* %1)
ret void
}