#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 main() {
  unsigned char a[] = {1, 2, 3};
  a[1] = 4;
  assert(a[0] == 1);
  assert(a[1] == 4);
  assert(a[2] == 3);
  unsigned short b[] = {1, 2, 3};
  b[1] = 4;
  assert(b[0] == 1);
  assert(b[1] == 4);
  assert(b[2] == 3);
  unsigned int c[] = {1, 2, 3};
  c[1] = 4;
  assert(c[0] == 1);
  assert(c[1] == 4);
  assert(c[2] == 3);
  unsigned long d[] = {1, 2, 3};
  d[1] = 4;
  assert(d[0] == 1);
  assert(d[1] == 4);
  assert(d[2] == 3);
  long x = 1;
  x <<= 40;
  x = 0;
  assert(x == 0);
  int *foo = (int *)x;
  foo = NULL;
  assert(foo == NULL);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xed2(%rip),%al
mov    %al,-0x5(%rbp)
movb   $0x4,-0x6(%rbp)
movzbl -0x7(%rbp),%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movzbl -0x6(%rbp),%eax
cmp    $0x4,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movzbl -0x5(%rbp),%eax
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    0xe8b(%rip),%eax
mov    %eax,-0xe(%rbp)
mov    0xe85(%rip),%ax
mov    %ax,-0xa(%rbp)
movw   $0x4,-0xc(%rbp)
movzwl -0xe(%rbp),%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movzwl -0xc(%rbp),%eax
cmp    $0x4,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movzwl -0xa(%rbp),%eax
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    0xe3c(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xe3a(%rip),%eax
mov    %eax,-0x14(%rbp)
movl   $0x4,-0x18(%rbp)
cmpl   $0x1,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x4,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x3,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    0xe02(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xdff(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xdfc(%rip),%rax
mov    %rax,-0x30(%rbp)
movq   $0x4,-0x38(%rbp)
cmpq   $0x1,-0x40(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x4,-0x38(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x3,-0x30(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movq   $0x1,-0x48(%rbp)
mov    -0x48(%rbp),%rax
shl    $0x28,%rax
mov    %rax,-0x48(%rbp)
movq   $0x0,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x48(%rbp),%rax
mov    %rax,-0x50(%rbp)
movq   $0x0,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.a = [3 x i8] c"\01\02\03"
@__const.main.b = [3 x i16] [i16 1, i16 2, i16 3]
@__const.main.c = [3 x i32] [i32 1, i32 2, i32 3]
@__const.main.d = [3 x i64] [i64 1, i64 2, i64 3]
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i8]
%3 = alloca [3 x i16]
%4 = alloca [3 x i32]
%5 = alloca [3 x i64]
%6 = alloca i64
%7 = alloca i32*
store i32 0, i32* %1
%8 = bitcast [3 x i8]* %2 to i8*
%9 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 1
store i8 4, i8* %9
%10 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = icmp eq i32 %12, 1
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 1
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = icmp eq i32 %18, 4
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
%22 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 2
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = icmp eq i32 %24, 3
%26 = zext i1 %25 to i32
%27 = call i32 @assert(i32 %26)
%28 = bitcast [3 x i16]* %3 to i8*
%29 = getelementptr inbounds [3 x i16], [3 x i16]* %3, i64 0, i64 1
store i16 4, i16* %29
%30 = getelementptr inbounds [3 x i16], [3 x i16]* %3, i64 0, i64 0
%31 = load i16, i16* %30
%32 = zext i16 %31 to i32
%33 = icmp eq i32 %32, 1
%34 = zext i1 %33 to i32
%35 = call i32 @assert(i32 %34)
%36 = getelementptr inbounds [3 x i16], [3 x i16]* %3, i64 0, i64 1
%37 = load i16, i16* %36
%38 = zext i16 %37 to i32
%39 = icmp eq i32 %38, 4
%40 = zext i1 %39 to i32
%41 = call i32 @assert(i32 %40)
%42 = getelementptr inbounds [3 x i16], [3 x i16]* %3, i64 0, i64 2
%43 = load i16, i16* %42
%44 = zext i16 %43 to i32
%45 = icmp eq i32 %44, 3
%46 = zext i1 %45 to i32
%47 = call i32 @assert(i32 %46)
%48 = bitcast [3 x i32]* %4 to i8*
%49 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 1
store i32 4, i32* %49
%50 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%51 = load i32, i32* %50
%52 = icmp eq i32 %51, 1
%53 = zext i1 %52 to i32
%54 = call i32 @assert(i32 %53)
%55 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 1
%56 = load i32, i32* %55
%57 = icmp eq i32 %56, 4
%58 = zext i1 %57 to i32
%59 = call i32 @assert(i32 %58)
%60 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 2
%61 = load i32, i32* %60
%62 = icmp eq i32 %61, 3
%63 = zext i1 %62 to i32
%64 = call i32 @assert(i32 %63)
%65 = bitcast [3 x i64]* %5 to i8*
%66 = getelementptr inbounds [3 x i64], [3 x i64]* %5, i64 0, i64 1
store i64 4, i64* %66
%67 = getelementptr inbounds [3 x i64], [3 x i64]* %5, i64 0, i64 0
%68 = load i64, i64* %67
%69 = icmp eq i64 %68, 1
%70 = zext i1 %69 to i32
%71 = call i32 @assert(i32 %70)
%72 = getelementptr inbounds [3 x i64], [3 x i64]* %5, i64 0, i64 1
%73 = load i64, i64* %72
%74 = icmp eq i64 %73, 4
%75 = zext i1 %74 to i32
%76 = call i32 @assert(i32 %75)
%77 = getelementptr inbounds [3 x i64], [3 x i64]* %5, i64 0, i64 2
%78 = load i64, i64* %77
%79 = icmp eq i64 %78, 3
%80 = zext i1 %79 to i32
%81 = call i32 @assert(i32 %80)
store i64 1, i64* %6
%82 = load i64, i64* %6
%83 = shl i64 %82, 40
store i64 %83, i64* %6
store i64 0, i64* %6
%84 = load i64, i64* %6
%85 = icmp eq i64 %84, 0
%86 = zext i1 %85 to i32
%87 = call i32 @assert(i32 %86)
%88 = load i64, i64* %6
%89 = inttoptr i64 %88 to i32*
store i32* %89, i32** %7
store i32* null, i32** %7
%90 = load i32*, i32** %7
%91 = icmp eq i32* %90, null
%92 = zext i1 %91 to i32
%93 = call i32 @assert(i32 %92)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 1)
%4 = tail call i32 @assert(i32 1)
%5 = tail call i32 @assert(i32 1)
%6 = tail call i32 @assert(i32 1)
%7 = tail call i32 @assert(i32 1)
%8 = tail call i32 @assert(i32 1)
%9 = tail call i32 @assert(i32 1)
%10 = tail call i32 @assert(i32 1)
%11 = tail call i32 @assert(i32 1)
%12 = tail call i32 @assert(i32 1)
%13 = tail call i32 @assert(i32 1)
%14 = tail call i32 @assert(i32 1)
ret i32 0
}