#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*/ memcpy(int *, int *, int);
int /*<<< orphan*/ printf(char *, int, int, int, int);
int main() {
  int a[4];
  a[0] = 12;
  a[1] = 23;
  a[2] = 34;
  a[3] = 45;
  printf("%d %d %d %d\n", a[0], a[1], a[2], a[3]);
  int b[4];
  memcpy(b, a, sizeof b);
  printf("%d %d %d %d\n", b[0], b[1], b[2], b[3]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xc,-0x20(%rbp)
movl   $0x17,-0x1c(%rbp)
movl   $0x22,-0x18(%rbp)
movl   $0x2d,-0x14(%rbp)
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x10,%edx
call   1040 <memcpy@plt>
mov    -0x30(%rbp),%esi
mov    -0x2c(%rbp),%edx
mov    -0x28(%rbp),%ecx
mov    -0x24(%rbp),%r8d
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0xc,%esi
mov    $0x17,%edx
mov    $0x22,%ecx
mov    $0x2d,%r8d
call   1030 <printf@plt>
mov    %rsp,%rdi
lea    0x10(%rsp),%rsi
mov    $0x10,%edx
call   1040 <memcpy@plt>
mov    (%rsp),%esi
mov    0x4(%rsp),%edx
mov    0x8(%rsp),%ecx
mov    0xc(%rsp),%r8d
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%d %d %d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = alloca [4 x i32]
store i32 0, i32* %1
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
store i32 12, i32* %4
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 1
store i32 23, i32* %5
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 2
store i32 34, i32* %6
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 3
store i32 45, i32* %7
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %8
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 1
%11 = load i32, i32* %10
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 2
%13 = load i32, i32* %12
%14 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 3
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %11, i32 %13, i32 %15)
%17 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%18 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%19 = call i32 @memcpy(i32* %17, i32* %18, i32 16)
%20 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%21 = load i32, i32* %20
%22 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 1
%23 = load i32, i32* %22
%24 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 2
%25 = load i32, i32* %24
%26 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 3
%27 = load i32, i32* %26
%28 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %21, i32 %23, i32 %25, i32 %27)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"%d %d %d %d\0A\00"
define i32 @main() {
%1 = alloca <4 x i32>
%2 = alloca [4 x i32]
%3 = bitcast <4 x i32>* %1 to i8*
%4 = getelementptr inbounds <4 x i32>, <4 x i32>* %1, i64 0, i64 0
store <4 x i32> <i32 12, i32 23, i32 34, i32 45>, <4 x i32>* %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 12, i32 23, i32 34, i32 45)
%6 = bitcast [4 x i32]* %2 to i8*
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%8 = call i32 @memcpy(i32* %7, i32* %4, i32 16)
%9 = load i32, i32* %7
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 1
%11 = load i32, i32* %10
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 2
%13 = load i32, i32* %12
%14 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 3
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %11, i32 %13, i32 %15)
ret i32 0
}