#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*/ ids;
typedef int /*<<< orphan*/ cids;

/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, unsigned int *, int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  unsigned int ids[100] = {0}, *pids;
  unsigned char cids[400], *pcids;
  unsigned int *tmp;
  int i = 0, j = 0;
  for (; i < 100; ++i) {
    ids[i] = i * i;
  }
  pcids = cids;
  pids = ids;
  memcpy(cids, ids, sizeof(ids));
  printf("----------------------\n");
  for (i = 0; i < 100; ++i) {
    tmp = (unsigned int *)(pcids + sizeof(unsigned int) * i);
    printf("%d\n", *tmp);
  }
  printf("unsigned int   --> %d\n", sizeof(unsigned int));
  printf("unsigned char  --> %d\n", sizeof(unsigned char));
  printf("unsigned char  --> %d\n", sizeof(cids));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x360,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1a0(%rbp),%rdi
xor    %esi,%esi
mov    $0x190,%edx
call   1040 <memset@plt>
movl   $0x0,-0x354(%rbp)
movl   $0x0,-0x358(%rbp)
cmpl   $0x64,-0x354(%rbp)
jge    11a5 <main+0x75>
mov    -0x354(%rbp),%ecx
imul   -0x354(%rbp),%ecx
movslq -0x354(%rbp),%rax
mov    %ecx,-0x1a0(%rbp,%rax,4)
mov    -0x354(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x354(%rbp)
jmp    1169 <main+0x39>
lea    -0x340(%rbp),%rax
mov    %rax,-0x348(%rbp)
lea    -0x1a0(%rbp),%rax
mov    %rax,-0x1a8(%rbp)
lea    -0x340(%rbp),%rdi
lea    -0x1a0(%rbp),%rsi
mov    $0x190,%edx
call   1050 <memcpy@plt>
lea    0xe20(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x354(%rbp)
cmpl   $0x64,-0x354(%rbp)
jge    1245 <main+0x115>
mov    -0x348(%rbp),%rax
movslq -0x354(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x350(%rbp)
mov    -0x350(%rbp),%rax
mov    (%rax),%esi
lea    0xe01(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x354(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x354(%rbp)
jmp    11f1 <main+0xc1>
lea    0xdcc(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdd0(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdbd(%rip),%rdi
mov    $0x190,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x360,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x328,%rsp
mov    %rsp,%rdi
mov    $0x190,%edx
xor    %esi,%esi
call   1050 <memset@plt>
mov    $0x4,%eax
xchg   %ax,%ax
lea    -0x4(%rax),%ecx
imul   %ecx,%ecx
mov    %ecx,-0x10(%rsp,%rax,4)
lea    -0x3(%rax),%ecx
imul   %ecx,%ecx
mov    %ecx,-0xc(%rsp,%rax,4)
lea    -0x2(%rax),%ecx
imul   %ecx,%ecx
mov    %ecx,-0x8(%rsp,%rax,4)
lea    -0x1(%rax),%ecx
imul   %ecx,%ecx
mov    %ecx,-0x4(%rsp,%rax,4)
mov    %eax,%ecx
imul   %eax,%ecx
mov    %ecx,(%rsp,%rax,4)
add    $0x5,%rax
cmp    $0x68,%rax
jne    1160 <main+0x20>
lea    0x190(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x190,%edx
call   1060 <memcpy@plt>
lea    0xe78(%rip),%rdi
call   1030 <puts@plt>
lea    0xe51(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x190(%rsp,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    $0x64,%rbx
jne    11d0 <main+0x90>
lea    0xe0e(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe12(%rip),%rbx
mov    $0x1,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x190,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x328,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [23 x i8] c"unsigned int --> %d\0A\00"
@.str.3 = [23 x i8] c"unsigned char --> %d\0A\00"
@str = [23 x i8] c"----------------------\00"
define i32 @main() {
%1 = alloca [100 x i32]
%2 = alloca [400 x i8]
%3 = bitcast [100 x i32]* %1 to i8*
%4 = getelementptr inbounds [400 x i8], [400 x i8]* %2, i64 0, i64 0
br label %5
5: ; preds = %5, %0
%6 = phi i64 [ 0, %0 ], [ %26, %5 ]
%7 = mul nuw nsw i64 %6, %6
%8 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %6
%9 = trunc i64 %7 to i32
store i32 %9, i32* %8
%10 = add nuw nsw i64 %6, 1
%11 = mul nuw nsw i64 %10, %10
%12 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %10
%13 = trunc i64 %11 to i32
store i32 %13, i32* %12
%14 = add nuw nsw i64 %6, 2
%15 = mul nuw nsw i64 %14, %14
%16 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %14
%17 = trunc i64 %15 to i32
store i32 %17, i32* %16
%18 = add nuw nsw i64 %6, 3
%19 = mul nuw nsw i64 %18, %18
%20 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %18
%21 = trunc i64 %19 to i32
store i32 %21, i32* %20
%22 = add nuw nsw i64 %6, 4
%23 = mul nuw nsw i64 %22, %22
%24 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %22
%25 = trunc i64 %23 to i32
store i32 %25, i32* %24
%26 = add nuw nsw i64 %6, 5
%27 = icmp eq i64 %26, 100
br i1 %27, label %28, label %5
28: ; preds = %5
%29 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
%30 = call i32 @memcpy(i8* %4, i32* %29, i32 400)
%31 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
br label %32
32: ; preds = %28, %32
%33 = phi i64 [ 0, %28 ], [ %39, %32 ]
%34 = shl nuw nsw i64 %33, 2
%35 = getelementptr inbounds [400 x i8], [400 x i8]* %2, i64 0, i64 %34
%36 = bitcast i8* %35 to i32*
%37 = load i32, i32* %36
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %37)
%39 = add nuw nsw i64 %33, 1
%40 = icmp eq i64 %39, 100
br i1 %40, label %41, label %32
41: ; preds = %32
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i64 4)
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i64 1)
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i64 400)
ret i32 0
}