#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*/ b;
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ memset(unsigned int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ my_memcpy(unsigned int *, unsigned int *, int);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  unsigned int a[10];
  unsigned int b[10];
  int i;
  memset(a, 0, sizeof(a));
  memset(b, 0, sizeof(b));
  for (i = 0; i < 10; ++i)
    a[i] = i + 1;
  my_memcpy(b, a, sizeof(a));
  for (i = 0; i < 10; ++i)
    printf("a[%d] = %d, b[%d] = %d\n", i, a[i], i, b[i]);
  printf("\n");
  printf("&a[5] = %p, a + 5 = %p\n", &a[5], a + 5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
movl   $0x0,-0x64(%rbp)
cmpl   $0xa,-0x64(%rbp)
jge    118c <main+0x5c>
mov    -0x64(%rbp),%ecx
add    $0x1,%ecx
movslq -0x64(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1166 <main+0x36>
lea    -0x60(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x28,%edx
call   1050 <my_memcpy@plt>
movl   $0x0,-0x64(%rbp)
cmpl   $0xa,-0x64(%rbp)
jge    11e2 <main+0xb2>
mov    -0x64(%rbp),%esi
movslq -0x64(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%edx
mov    -0x64(%rbp),%ecx
movslq -0x64(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%r8d
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    11a5 <main+0x75>
lea    0xe2d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rsi
add    $0x14,%rsi
lea    -0x30(%rbp),%rdx
add    $0x14,%rdx
lea    0xe11(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x60,%rsp
mov    %rsp,%r15
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1050 <memset@plt>
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1050 <memset@plt>
movaps 0xe8a(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x14(%rsp),%r14
movaps 0xe8a(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movabs $0xa00000009,%rax
mov    %rax,0x20(%rsp)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x28,%edx
call   1060 <my_memcpy@plt>
mov    (%rsp),%edx
mov    0x30(%rsp),%r8d
lea    0xe67(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %ecx,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%edx
mov    0x34(%rsp),%r8d
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%edx
mov    0x38(%rsp),%r8d
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x2,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%edx
mov    0x3c(%rsp),%r8d
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x3,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%edx
mov    0x40(%rsp),%r8d
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x4,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp),%edx
mov    0x44(%rsp),%r8d
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x5,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rsp),%edx
mov    0x48(%rsp),%r8d
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x6,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%rsp),%edx
mov    0x4c(%rsp),%r8d
mov    %rbx,%rdi
mov    $0x7,%esi
mov    $0x7,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rsp),%edx
mov    0x50(%rsp),%r8d
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x8,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x24(%rsp),%edx
mov    0x54(%rsp),%r8d
mov    %rbx,%rdi
mov    $0x9,%esi
mov    $0x9,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd5b(%rip),%rdi
mov    %r14,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [24 x i8] c"a[%d] = %d, b[%d] = %d\0A\00"
@.str.2 = [24 x i8] c"&a[5] = %p, a + 5 = %p\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca [10 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [10 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = call i32 @memset(i32* %5, i32 0, i32 40)
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%8 = call i32 @memset(i32* %7, i32 0, i32 40)
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
%12 = bitcast [10 x i32]* %1 to <4 x i32>*
store <4 x i32> <i32 1, i32 2, i32 3, i32 4>, <4 x i32>* %12
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
%16 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
%17 = bitcast i32* %13 to <4 x i32>*
store <4 x i32> <i32 5, i32 6, i32 7, i32 8>, <4 x i32>* %17
%18 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
store i32 9, i32* %18
%19 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
store i32 10, i32* %19
%20 = call i32 @my_memcpy(i32* %7, i32* %5, i32 40)
%21 = load i32, i32* %5
%22 = load i32, i32* %7
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 0, i32 %21, i32 0, i32 %22)
%24 = load i32, i32* %9
%25 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 1
%26 = load i32, i32* %25
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 1, i32 %24, i32 1, i32 %26)
%28 = load i32, i32* %10
%29 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 2
%30 = load i32, i32* %29
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 2, i32 %28, i32 2, i32 %30)
%32 = load i32, i32* %11
%33 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 3
%34 = load i32, i32* %33
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 3, i32 %32, i32 3, i32 %34)
%36 = load i32, i32* %13
%37 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 4
%38 = load i32, i32* %37
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 4, i32 %36, i32 4, i32 %38)
%40 = load i32, i32* %14
%41 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 5
%42 = load i32, i32* %41
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 5, i32 %40, i32 5, i32 %42)
%44 = load i32, i32* %15
%45 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 6
%46 = load i32, i32* %45
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 6, i32 %44, i32 6, i32 %46)
%48 = load i32, i32* %16
%49 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 7
%50 = load i32, i32* %49
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 7, i32 %48, i32 7, i32 %50)
%52 = load i32, i32* %18
%53 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 8
%54 = load i32, i32* %53
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 8, i32 %52, i32 8, i32 %54)
%56 = load i32, i32* %19
%57 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 9
%58 = load i32, i32* %57
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 9, i32 %56, i32 9, i32 %58)
%60 = call i32 @putchar(i32 10)
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32* %14, i32* %14)
ret i32 0
}