#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*/ fprintf(int /*<<< orphan*/, char *, unsigned int, ...);
int /*<<< orphan*/ stderr;
int main() {
  unsigned short int read_16 = 0xF1F2;
  unsigned int read_32 = 0xF1F2F3F4;
  unsigned short int write_16 = 0xF00D;
  unsigned int write_32 = 0xF00DFEED;
  fprintf(stderr, "%04x %04x\n", *((unsigned short int *)((char *)&read_16)),
          *((unsigned short int *)((char *)&read_16 + 1)));
  fprintf(stderr, "%04x %04x\n", *((short int *)((char *)&read_16)),
          *((short int *)((char *)&read_16 + 1)));
  fprintf(stderr, "%08x %08x %08x %08x\n", *((int *)((char *)&read_32)),
          *((int *)((char *)&read_32 + 1)), *((int *)((char *)&read_32 + 2)),
          *((int *)((char *)&read_32 + 3)));
  *((short int *)((char *)&write_16)) = 0xF00D;
  *((short int *)((char *)&write_16) + 1) = 0xF00D;
  fprintf(stderr, "%04x\n", write_16);
  *((int *)((char *)&write_16)) = 0xF00DFEED;
  *((int *)((char *)&write_16) + 1) = 0xF00DFEED;
  *((int *)((char *)&write_16) + 2) = 0xF00DFEED;
  *((int *)((char *)&write_16) + 3) = 0xF00DFEED;
  fprintf(stderr, "%08x\n", write_32);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0xf1f2,-0x6(%rbp)
movl   $0xf1f2f3f4,-0xc(%rbp)
movw   $0xf00d,-0xe(%rbp)
movl   $0xf00dfeed,-0x14(%rbp)
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
movzwl -0x6(%rbp),%edx
movzwl -0x5(%rbp),%ecx
lea    0xeaf(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
movswl -0x6(%rbp),%edx
movswl -0x5(%rbp),%ecx
lea    0xe90(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
mov    -0xb(%rbp),%ecx
mov    -0xa(%rbp),%r8d
mov    -0x9(%rbp),%r9d
lea    0xe76(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movw   $0xf00d,-0xe(%rbp)
movw   $0xf00d,-0xc(%rbp)
mov    0x2e31(%rip),%rax
mov    (%rax),%edi
movzwl -0xe(%rbp),%edx
lea    0xe49(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0xf00dfeed,-0xe(%rbp)
movl   $0xf00dfeed,-0xa(%rbp)
movl   $0xf00dfeed,-0x6(%rbp)
movl   $0xf00dfeed,-0x2(%rbp)
mov    0x2dfa(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
lea    0xe28(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%edi
lea    0xedc(%rip),%r14
mov    %r14,%rsi
mov    $0xf1f2,%edx
mov    $0xf1,%ecx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
mov    %r14,%rsi
mov    $0xfffff1f2,%edx
mov    $0xf1,%ecx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeb4(%rip),%rsi
mov    $0xf1f2f3f4,%edx
mov    $0xf1f2f3,%ecx
mov    $0xf1f2,%r8d
mov    $0xf1,%r9d
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xe88(%rip),%rsi
mov    $0xf00d,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xe88(%rip),%rsi
mov    $0xf00dfeed,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"%04x %04x\0A\00"
@.str.1 = [21 x i8] c"%08x %08x %08x %08x\0A\00"
@.str.2 = [6 x i8] c"%04x\0A\00"
@.str.3 = [6 x i8] c"%08x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i32
%4 = alloca i16
%5 = alloca i32
store i32 0, i32* %1
store i16 -3598, i16* %2
store i32 -235736076, i32* %3
store i16 -4083, i16* %4
store i32 -267518227, i32* %5
%6 = load i32, i32* @stderr
%7 = bitcast i16* %2 to i8*
%8 = bitcast i8* %7 to i16*
%9 = load i16, i16* %8
%10 = zext i16 %9 to i32
%11 = bitcast i16* %2 to i8*
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = bitcast i8* %12 to i16*
%14 = load i16, i16* %13
%15 = zext i16 %14 to i32
%16 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %15)
%17 = load i32, i32* @stderr
%18 = bitcast i16* %2 to i8*
%19 = bitcast i8* %18 to i16*
%20 = load i16, i16* %19
%21 = sext i16 %20 to i32
%22 = bitcast i16* %2 to i8*
%23 = getelementptr inbounds i8, i8* %22, i64 1
%24 = bitcast i8* %23 to i16*
%25 = load i16, i16* %24
%26 = sext i16 %25 to i32
%27 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %21, i32 %26)
%28 = load i32, i32* @stderr
%29 = bitcast i32* %3 to i8*
%30 = bitcast i8* %29 to i32*
%31 = load i32, i32* %30
%32 = bitcast i32* %3 to i8*
%33 = getelementptr inbounds i8, i8* %32, i64 1
%34 = bitcast i8* %33 to i32*
%35 = load i32, i32* %34
%36 = bitcast i32* %3 to i8*
%37 = getelementptr inbounds i8, i8* %36, i64 2
%38 = bitcast i8* %37 to i32*
%39 = load i32, i32* %38
%40 = bitcast i32* %3 to i8*
%41 = getelementptr inbounds i8, i8* %40, i64 3
%42 = bitcast i8* %41 to i32*
%43 = load i32, i32* %42
%44 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %31, i32 %35, i32 %39, i32 %43)
%45 = bitcast i16* %4 to i8*
%46 = bitcast i8* %45 to i16*
store i16 -4083, i16* %46
%47 = bitcast i16* %4 to i8*
%48 = bitcast i8* %47 to i16*
%49 = getelementptr inbounds i16, i16* %48, i64 1
store i16 -4083, i16* %49
%50 = load i32, i32* @stderr
%51 = load i16, i16* %4
%52 = zext i16 %51 to i32
%53 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %50, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %52)
%54 = bitcast i16* %4 to i8*
%55 = bitcast i8* %54 to i32*
store i32 -267518227, i32* %55
%56 = bitcast i16* %4 to i8*
%57 = bitcast i8* %56 to i32*
%58 = getelementptr inbounds i32, i32* %57, i64 1
store i32 -267518227, i32* %58
%59 = bitcast i16* %4 to i8*
%60 = bitcast i8* %59 to i32*
%61 = getelementptr inbounds i32, i32* %60, i64 2
store i32 -267518227, i32* %61
%62 = bitcast i16* %4 to i8*
%63 = bitcast i8* %62 to i32*
%64 = getelementptr inbounds i32, i32* %63, i64 3
store i32 -267518227, i32* %64
%65 = load i32, i32* @stderr
%66 = load i32, i32* %5
%67 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %65, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %66)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"%04x %04x\0A\00"
@.str.1 = [21 x i8] c"%08x %08x %08x %08x\0A\00"
@.str.2 = [6 x i8] c"%04x\0A\00"
@.str.3 = [6 x i8] c"%08x\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 (i32, i8*, i32, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 61938, i32 241)
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, i32, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 -3598, i32 241)
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, i32, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 -235736076, i32 15856371, i32 61938, i32 241)
%7 = load i32, i32* @stderr
%8 = tail call i32 (i32, i8*, i32, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 61453)
%9 = load i32, i32* @stderr
%10 = tail call i32 (i32, i8*, i32, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 -267518227)
ret i32 0
}