#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*/ iii;
typedef int /*<<< orphan*/ ii;

/* Variables and functions */
int /*<<< orphan*/ get(unsigned char *);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned int *, int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  unsigned int ii[] = {5, 3, [5] = 10}, iii = 111;
  unsigned char index[sizeof(ii)];
  unsigned char index2[4];
  memcpy(index, ii, sizeof(ii));
  memcpy(index2, &iii, sizeof(iii));
  get(index2);
  unsigned int *pInt;
  for (int i = 0; i < (sizeof(ii) / sizeof(unsigned int)); ++i) {
    pInt = (unsigned int *)(index + sizeof(unsigned int) * i);
    printf("%d\n", *pInt);
  }
  printf("-----------------------------------------------------\n");
  printf("sizeof(ii) --> %ld\n", sizeof(ii));
  printf("sizeof(ii) --> %ld\n", sizeof(unsigned int) * 11);
  printf("-----------------------------------------------------\n");
  printf("*(unsigned int *) (index)  --> %d\n", *(unsigned int *)(index));
  printf("-----------------------------------------------------\n");
  printf("*(unsigned int *) (index2) --> %d\n", *(unsigned int *)(index2));
  printf("-----------------------------------------------------\n");
  printf("sizeof(int)  -->  %ld\n", sizeof(int));
  printf("sizeof(unsigned int)  -->  %ld\n", sizeof(unsigned int));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x6f,-0x24(%rbp)
lea    -0x40(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x18,%edx
call   1040 <memcpy@plt>
lea    -0x44(%rbp),%rdi
lea    -0x24(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
lea    -0x44(%rbp),%rdi
call   1050 <get@plt>
movl   $0x0,-0x54(%rbp)
movslq -0x54(%rbp),%rax
cmp    $0x6,%rax
jae    11de <main+0xae>
lea    -0x40(%rbp),%rax
movslq -0x54(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
mov    (%rax),%esi
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    119b <main+0x6b>
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe5c(%rip),%rdi
mov    $0x18,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe49(%rip),%rdi
mov    $0x2c,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdff(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x40(%rbp),%esi
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xde0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x44(%rbp),%esi
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdc1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe44(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe48(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    0xec2(%rip),%rax
mov    %rax,0x40(%rsp)
movaps 0xea6(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movl   $0x6f,0xc(%rsp)
lea    0x10(%rsp),%rdi
lea    0x30(%rsp),%rsi
mov    $0x18,%edx
call   1050 <memcpy@plt>
lea    0x8(%rsp),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1050 <memcpy@plt>
mov    %rbx,%rdi
call   1060 <get@plt>
mov    0x10(%rsp),%esi
lea    0xea6(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x24(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xead(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xe0d(%rip),%rbx
mov    $0x18,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2c,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    0x10(%rsp),%esi
lea    0xdf0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    0x8(%rsp),%esi
lea    0xdf9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xe06(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe0a(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.ii = [6 x i32] [i32 5, i32 3, i32 0, i32 0, i32 0, i32 10]
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [55 x i8] c"-----------------------------------------------------\0A\00"
@.str.2 = [20 x i8] c"sizeof(ii) --> %ld\0A\00"
@.str.3 = [35 x i8] c"*(unsigned int *) (index) --> %d\0A\00"
@.str.4 = [35 x i8] c"*(unsigned int *) (index2) --> %d\0A\00"
@.str.5 = [23 x i8] c"sizeof(int) --> %ld\0A\00"
@.str.6 = [32 x i8] c"sizeof(unsigned int) --> %ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i32]
%3 = alloca i32
%4 = alloca [24 x i8]
%5 = alloca [4 x i8]
%6 = alloca i32*
%7 = alloca i32
store i32 0, i32* %1
%8 = bitcast [6 x i32]* %2 to i8*
store i32 111, i32* %3
%9 = getelementptr inbounds [24 x i8], [24 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%11 = call i32 @memcpy(i8* %9, i32* %10, i32 24)
%12 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%13 = call i32 @memcpy(i8* %12, i32* %3, i32 4)
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%15 = call i32 @get(i8* %14)
store i32 0, i32* %7
br label %16
16: ; preds = %30, %0
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = icmp ult i64 %18, 6
br i1 %19, label %20, label %33
20: ; preds = %16
%21 = getelementptr inbounds [24 x i8], [24 x i8]* %4, i64 0, i64 0
%22 = load i32, i32* %7
%23 = sext i32 %22 to i64
%24 = mul i64 4, %23
%25 = getelementptr inbounds i8, i8* %21, i64 %24
%26 = bitcast i8* %25 to i32*
store i32* %26, i32** %6
%27 = load i32*, i32** %6
%28 = load i32, i32* %27
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %28)
br label %30
30: ; preds = %20
%31 = load i32, i32* %7
%32 = add nsw i32 %31, 1
store i32 %32, i32* %7
br label %16
33: ; preds = %16
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i64 24)
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i64 44)
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%38 = getelementptr inbounds [24 x i8], [24 x i8]* %4, i64 0, i64 0
%39 = bitcast i8* %38 to i32*
%40 = load i32, i32* %39
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i32 %40)
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%43 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%44 = bitcast i8* %43 to i32*
%45 = load i32, i32* %44
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i32 %45)
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i64 4)
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i64 4)
%50 = load i32, i32* %1
ret i32 %50
}

LLVM IR (-O2):
@__const.main.ii = [6 x i32] [i32 5, i32 3, i32 0, i32 0, i32 0, i32 10]
@.str = [4 x i8] c"%d\0A\00"
@.str.2 = [20 x i8] c"sizeof(ii) --> %ld\0A\00"
@.str.3 = [35 x i8] c"*(unsigned int *) (index) --> %d\0A\00"
@.str.4 = [35 x i8] c"*(unsigned int *) (index2) --> %d\0A\00"
@.str.5 = [23 x i8] c"sizeof(int) --> %ld\0A\00"
@.str.6 = [32 x i8] c"sizeof(unsigned int) --> %ld\0A\00"
@str.9 = [54 x i8] c"-----------------------------------------------------\00"
define i32 @main() {
%1 = alloca [6 x i32]
%2 = alloca i32
%3 = alloca [24 x i8]
%4 = alloca i32
%5 = bitcast [6 x i32]* %1 to i8*
%6 = bitcast i32* %2 to i8*
store i32 111, i32* %2
%7 = getelementptr inbounds [24 x i8], [24 x i8]* %3, i64 0, i64 0
%8 = bitcast i32* %4 to i8*
%9 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%10 = call i32 @memcpy(i8* %7, i32* %9, i32 24)
%11 = call i32 @memcpy(i8* %8, i32* %2, i32 4)
%12 = call i32 @get(i8* %8)
%13 = bitcast [24 x i8]* %3 to i32*
%14 = load i32, i32* %13
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = getelementptr inbounds [24 x i8], [24 x i8]* %3, i64 0, i64 4
%17 = bitcast i8* %16 to i32*
%18 = load i32, i32* %17
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %18)
%20 = getelementptr inbounds [24 x i8], [24 x i8]* %3, i64 0, i64 8
%21 = bitcast i8* %20 to i32*
%22 = load i32, i32* %21
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %22)
%24 = getelementptr inbounds [24 x i8], [24 x i8]* %3, i64 0, i64 12
%25 = bitcast i8* %24 to i32*
%26 = load i32, i32* %25
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %26)
%28 = getelementptr inbounds [24 x i8], [24 x i8]* %3, i64 0, i64 16
%29 = bitcast i8* %28 to i32*
%30 = load i32, i32* %29
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %30)
%32 = getelementptr inbounds [24 x i8], [24 x i8]* %3, i64 0, i64 20
%33 = bitcast i8* %32 to i32*
%34 = load i32, i32* %33
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %34)
%36 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.9, i64 0, i64 0))
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i64 24)
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i64 44)
%39 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.9, i64 0, i64 0))
%40 = bitcast [24 x i8]* %3 to i32*
%41 = load i32, i32* %40
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i32 %41)
%43 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.9, i64 0, i64 0))
%44 = load i32, i32* %4
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i32 %44)
%46 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.9, i64 0, i64 0))
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i64 4)
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), i64 4)
ret i32 0
}