#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*/ printf(char *, int);
void dispArray(unsigned char *cPtr, int size) {
  int ii;
  int *iPtr;
  unsigned short *sPtr;
  float *fPtr;
  iPtr = (int *)cPtr;
  printf("\niVal = %x", *iPtr++);
  cPtr = (char *)iPtr;
  printf("\ncVal = %x", *cPtr++);
  fPtr = (float *)cPtr;
  printf("\nfVal = %x", *fPtr++);
  sPtr = (unsigned short *)fPtr;
  printf("\nsVal = %x", *sPtr++);
  iPtr = (int *)sPtr;
  printf("\niVal1= %x\n", *iPtr);
}


x86 assembly (clang, -O0):
<dispArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x28(%rbp)
cvttss2si (%rax),%esi
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x2,%rcx
mov    %rcx,-0x20(%rbp)
movzwl (%rax),%esi
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xe60(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dispArray>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%esi
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
movzbl 0x4(%rbx),%esi
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
cvttss2si 0x5(%rbx),%esi
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
movzwl 0x9(%rbx),%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    0xb(%rbx),%esi
lea    0xecf(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"\0AiVal = %x\00"
@.str.1 = [11 x i8] c"\0AcVal = %x\00"
@.str.2 = [11 x i8] c"\0AfVal = %x\00"
@.str.3 = [11 x i8] c"\0AsVal = %x\00"
@.str.4 = [12 x i8] c"\0AiVal1= %x\0A\00"
define void @dispArray(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i16*
%8 = alloca float*
store i8* %0, i8** %3
store i32 %1, i32* %4
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %6
%12 = getelementptr inbounds i32, i32* %11, i32 1
store i32* %12, i32** %6
%13 = load i32, i32* %11
%14 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = load i32*, i32** %6
%16 = bitcast i32* %15 to i8*
store i8* %16, i8** %3
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %3
%19 = load i8, i8* %17
%20 = zext i8 %19 to i32
%21 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %20)
%22 = load i8*, i8** %3
%23 = bitcast i8* %22 to float*
store float* %23, float** %8
%24 = load float*, float** %8
%25 = getelementptr inbounds float, float* %24, i32 1
store float* %25, float** %8
%26 = load float, float* %24
%27 = fptosi float %26 to i32
%28 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %27)
%29 = load float*, float** %8
%30 = bitcast float* %29 to i16*
store i16* %30, i16** %7
%31 = load i16*, i16** %7
%32 = getelementptr inbounds i16, i16* %31, i32 1
store i16* %32, i16** %7
%33 = load i16, i16* %31
%34 = zext i16 %33 to i32
%35 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %34)
%36 = load i16*, i16** %7
%37 = bitcast i16* %36 to i32*
store i32* %37, i32** %6
%38 = load i32*, i32** %6
%39 = load i32, i32* %38
%40 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %39)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\0AiVal = %x\00"
@.str.1 = [11 x i8] c"\0AcVal = %x\00"
@.str.2 = [11 x i8] c"\0AfVal = %x\00"
@.str.3 = [11 x i8] c"\0AsVal = %x\00"
@.str.4 = [12 x i8] c"\0AiVal1= %x\0A\00"
define void @dispArray(i8* nocapture %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = getelementptr inbounds i8, i8* %0, i64 4
%5 = load i32, i32* %3
%6 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds i8, i8* %0, i64 5
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
%10 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = bitcast i8* %7 to float*
%12 = getelementptr inbounds i8, i8* %0, i64 9
%13 = load float, float* %11
%14 = fptosi float %13 to i32
%15 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %14)
%16 = bitcast i8* %12 to i16*
%17 = getelementptr inbounds i8, i8* %0, i64 11
%18 = load i16, i16* %16
%19 = zext i16 %18 to i32
%20 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %19)
%21 = bitcast i8* %17 to i32*
%22 = load i32, i32* %21
%23 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %22)
ret void
}