#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*/ printf(char *, unsigned short, ...);
int main(void) {
  unsigned char cc[] = {0x01, 0x01, 0xd2, 0x00};
  unsigned short s1, s2, *ps, s;
  unsigned int i;
  s1 = (((unsigned short)cc[1]) << 8) | cc[0];
  s2 = (((unsigned short)cc[3]) << 8) | cc[2];
  i = (cc[0] << 64) | (cc[1] << 32) | (cc[2] << 16) | (cc[3] << 8);
  printf("c[0]: %d, c[1]: %d, c[2]: %d, c[3]: %d\n", cc[0], cc[1], cc[2],
         cc[3]);
  printf("s1: %d, s2: %d\n", s1, s2);
  printf("i: %d\n", i);
  ps = cc;
  s = *ps;
  printf("ps: %d, s: %d\n", *ps, s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0x8(%rbp)
movzbl -0x7(%rbp),%eax
movzwl %ax,%eax
shl    $0x8,%eax
movzbl -0x8(%rbp),%ecx
or     %ecx,%eax
mov    %ax,-0xa(%rbp)
movzbl -0x5(%rbp),%eax
movzwl %ax,%eax
shl    $0x8,%eax
movzbl -0x6(%rbp),%ecx
or     %ecx,%eax
mov    %ax,-0xc(%rbp)
movzbl -0x8(%rbp),%eax
mov    $0x40,%ecx
shl    %cl,%eax
movzbl -0x7(%rbp),%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzbl -0x6(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
movzbl -0x5(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x20(%rbp)
movzbl -0x8(%rbp),%eax
movzbl -0x7(%rbp),%edx
movzbl -0x6(%rbp),%ecx
movzbl -0x5(%rbp),%r8d
lea    0xe6d(%rip),%rdi
movzwl %ax,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xa(%rbp),%ax
movzwl -0xc(%rbp),%edx
lea    0xe7c(%rip),%rdi
movzwl %ax,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
lea    0xe78(%rip),%rdi
movzwl %ax,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x1a(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ax
movzwl -0x1a(%rbp),%edx
lea    0xe50(%rip),%rdi
movzwl %ax,%esi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0xd2,%ecx
xor    %r8d,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
mov    $0x101,%esi
mov    $0xd2,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    $0x101,%esi
mov    $0x101,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.cc = [4 x i8] c"\01\01\D2\00"
@.str = [40 x i8] c"c[0]: %d, c[1]: %d, c[2]: %d, c[3]: %d\0A\00"
@.str.1 = [16 x i8] c"s1: %d, s2: %d\0A\00"
@.str.2 = [7 x i8] c"i: %d\0A\00"
@.str.3 = [15 x i8] c"ps: %d, s: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i8]
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16*
%6 = alloca i16
%7 = alloca i32
store i32 0, i32* %1
%8 = bitcast [4 x i8]* %2 to i8*
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i16
%12 = zext i16 %11 to i32
%13 = shl i32 %12, 8
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = or i32 %13, %16
%18 = trunc i32 %17 to i16
store i16 %18, i16* %3
%19 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 3
%20 = load i8, i8* %19
%21 = zext i8 %20 to i16
%22 = zext i16 %21 to i32
%23 = shl i32 %22, 8
%24 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 2
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = or i32 %23, %26
%28 = trunc i32 %27 to i16
store i16 %28, i16* %4
%29 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%30 = load i8, i8* %29
%31 = zext i8 %30 to i32
%32 = shl i32 %31, 64
%33 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 1
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
%36 = shl i32 %35, 32
%37 = or i32 %32, %36
%38 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 2
%39 = load i8, i8* %38
%40 = zext i8 %39 to i32
%41 = shl i32 %40, 16
%42 = or i32 %37, %41
%43 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 3
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = shl i32 %45, 8
%47 = or i32 %42, %46
store i32 %47, i32* %7
%48 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%49 = load i8, i8* %48
%50 = zext i8 %49 to i16
%51 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 1
%52 = load i8, i8* %51
%53 = zext i8 %52 to i32
%54 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 2
%55 = load i8, i8* %54
%56 = zext i8 %55 to i32
%57 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 3
%58 = load i8, i8* %57
%59 = zext i8 %58 to i32
%60 = call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i16 zeroext %50, i32 %53, i32 %56, i32 %59)
%61 = load i16, i16* %3
%62 = load i16, i16* %4
%63 = zext i16 %62 to i32
%64 = call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i16 zeroext %61, i32 %63)
%65 = load i32, i32* %7
%66 = trunc i32 %65 to i16
%67 = call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i16 zeroext %66)
%68 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%69 = bitcast i8* %68 to i16*
store i16* %69, i16** %5
%70 = load i16*, i16** %5
%71 = load i16, i16* %70
store i16 %71, i16* %6
%72 = load i16*, i16** %5
%73 = load i16, i16* %72
%74 = load i16, i16* %6
%75 = zext i16 %74 to i32
%76 = call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i16 zeroext %73, i32 %75)
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"c[0]: %d, c[1]: %d, c[2]: %d, c[3]: %d\0A\00"
@.str.1 = [16 x i8] c"s1: %d, s2: %d\0A\00"
@.str.2 = [7 x i8] c"i: %d\0A\00"
@.str.3 = [15 x i8] c"ps: %d, s: %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i16 zeroext 1, i32 1, i32 210, i32 0)
%2 = tail call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i16 zeroext 257, i32 210)
%3 = tail call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i16 zeroext poison)
%4 = tail call i32 (i8*, i16, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i16 zeroext 257, i32 257)
ret i32 0
}