#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*/ assert(int);
int /*<<< orphan*/ memcpy(unsigned int *, unsigned int *, int);
int main() {
  unsigned int src1[2] = {1, 3};
  unsigned int dest1[2] = {0, 0};
  memcpy(dest1, src1, 4);
  assert(dest1[0] == 0);
  unsigned int src2[2] = {1, 3};
  unsigned int dest2[2] = {0, 0};
  memcpy(dest2, src2, 32);
  assert(dest2[0] == 1);
  unsigned int src3[2] = {0xFFFFFFFF, 3};
  unsigned int dest3[2] = {0, 0};
  memcpy(dest3, src3, 4);
  assert(dest3[0] == 0xF0000000);
  unsigned int src4[2] = {0xFFFFFFFF, 3};
  unsigned int dest4[2] = {0, 0};
  memcpy(dest4, src4, 16);
  assert(dest4[0] == 0xFFFFFFFF << (32 - 16));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0xc(%rbp)
lea    -0x14(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
lea    -0x14(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1050 <memcpy@plt>
cmpl   $0x0,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    0xe7c(%rip),%rax
mov    %rax,-0x1c(%rbp)
lea    -0x24(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
lea    -0x24(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x20,%edx
call   1050 <memcpy@plt>
cmpl   $0x1,-0x24(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    0xe46(%rip),%rax
mov    %rax,-0x2c(%rbp)
lea    -0x34(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
lea    -0x34(%rbp),%rdi
lea    -0x2c(%rbp),%rsi
mov    $0x4,%edx
call   1050 <memcpy@plt>
cmpl   $0xf0000000,-0x34(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    0xe05(%rip),%rax
mov    %rax,-0x3c(%rbp)
lea    -0x44(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
lea    -0x44(%rbp),%rdi
lea    -0x3c(%rbp),%rsi
mov    $0x10,%edx
call   1050 <memcpy@plt>
cmpl   $0xffff0000,-0x44(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
movabs $0x300000001,%rbx
mov    %rbx,0x38(%rsp)
movq   $0x0,0x18(%rsp)
lea    0x18(%rsp),%rdi
lea    0x38(%rsp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
xor    %edi,%edi
cmpl   $0x0,0x18(%rsp)
sete   %dil
call   1030 <assert@plt>
mov    %rbx,0x30(%rsp)
movq   $0x0,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0x30(%rsp),%rsi
mov    $0x20,%edx
call   1040 <memcpy@plt>
xor    %edi,%edi
cmpl   $0x1,0x10(%rsp)
sete   %dil
call   1030 <assert@plt>
movabs $0x3ffffffff,%rbx
mov    %rbx,0x28(%rsp)
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rdi
lea    0x28(%rsp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
xor    %edi,%edi
cmpl   $0xf0000000,0x8(%rsp)
f0
sete   %dil
call   1030 <assert@plt>
mov    %rbx,0x20(%rsp)
movq   $0x0,(%rsp)
mov    %rsp,%rdi
lea    0x20(%rsp),%rsi
mov    $0x10,%edx
call   1040 <memcpy@plt>
xor    %edi,%edi
cmpl   $0xffff0000,(%rsp)
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.src1 = [2 x i32] [i32 1, i32 3]
@__const.main.src2 = [2 x i32] [i32 1, i32 3]
@__const.main.src3 = [2 x i32] [i32 -1, i32 3]
@__const.main.src4 = [2 x i32] [i32 -1, i32 3]
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
%3 = alloca [2 x i32]
%4 = alloca [2 x i32]
%5 = alloca [2 x i32]
%6 = alloca [2 x i32]
%7 = alloca [2 x i32]
%8 = alloca [2 x i32]
%9 = alloca [2 x i32]
store i32 0, i32* %1
%10 = bitcast [2 x i32]* %2 to i8*
%11 = bitcast [2 x i32]* %3 to i8*
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%14 = call i32 @memcpy(i32* %12, i32* %13, i32 4)
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%16 = load i32, i32* %15
%17 = icmp eq i32 %16, 0
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
%20 = bitcast [2 x i32]* %4 to i8*
%21 = bitcast [2 x i32]* %5 to i8*
%22 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%23 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%24 = call i32 @memcpy(i32* %22, i32* %23, i32 32)
%25 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%26 = load i32, i32* %25
%27 = icmp eq i32 %26, 1
%28 = zext i1 %27 to i32
%29 = call i32 @assert(i32 %28)
%30 = bitcast [2 x i32]* %6 to i8*
%31 = bitcast [2 x i32]* %7 to i8*
%32 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%33 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%34 = call i32 @memcpy(i32* %32, i32* %33, i32 4)
%35 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%36 = load i32, i32* %35
%37 = icmp eq i32 %36, -268435456
%38 = zext i1 %37 to i32
%39 = call i32 @assert(i32 %38)
%40 = bitcast [2 x i32]* %8 to i8*
%41 = bitcast [2 x i32]* %9 to i8*
%42 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%43 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%44 = call i32 @memcpy(i32* %42, i32* %43, i32 16)
%45 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%46 = load i32, i32* %45
%47 = icmp eq i32 %46, -65536
%48 = zext i1 %47 to i32
%49 = call i32 @assert(i32 %48)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = bitcast i64* %1 to i8*
store i64 12884901889, i64* %1
%10 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%11 = bitcast i64* %2 to i32*
%12 = bitcast i64* %1 to i32*
%13 = call i32 @memcpy(i32* %11, i32* %12, i32 4)
%14 = load i32, i32* %11
%15 = icmp eq i32 %14, 0
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = bitcast i64* %3 to i8*
store i64 12884901889, i64* %3
%19 = bitcast i64* %4 to i8*
store i64 0, i64* %4
%20 = bitcast i64* %4 to i32*
%21 = bitcast i64* %3 to i32*
%22 = call i32 @memcpy(i32* %20, i32* %21, i32 32)
%23 = load i32, i32* %20
%24 = icmp eq i32 %23, 1
%25 = zext i1 %24 to i32
%26 = call i32 @assert(i32 %25)
%27 = bitcast i64* %5 to i8*
store i64 17179869183, i64* %5
%28 = bitcast i64* %6 to i8*
store i64 0, i64* %6
%29 = bitcast i64* %6 to i32*
%30 = bitcast i64* %5 to i32*
%31 = call i32 @memcpy(i32* %29, i32* %30, i32 4)
%32 = load i32, i32* %29
%33 = icmp eq i32 %32, -268435456
%34 = zext i1 %33 to i32
%35 = call i32 @assert(i32 %34)
%36 = bitcast i64* %7 to i8*
store i64 17179869183, i64* %7
%37 = bitcast i64* %8 to i8*
store i64 0, i64* %8
%38 = bitcast i64* %8 to i32*
%39 = bitcast i64* %7 to i32*
%40 = call i32 @memcpy(i32* %38, i32* %39, i32 16)
%41 = load i32, i32* %38
%42 = icmp eq i32 %41, -65536
%43 = zext i1 %42 to i32
%44 = call i32 @assert(i32 %43)
ret i32 0
}