#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 */
typedef int uint8_t;
typedef int int16_t;

/* Variables and functions */
int /*<<< orphan*/ assertTrue(char *, int);
void test_int16() {
  int16_t shorts[4];
  shorts[0] = -325;
  shorts[1] = 32767;
  shorts[2] = -32768;
  shorts[3] = 128;
  uint8_t *pb = &shorts[0];
  assertTrue("pb[0] == 0xbb", pb[0] == 0xbb);
  ;
  assertTrue("pb[1] == 0xfe", pb[1] == 0xfe);
  ;
  assertTrue("pb[2] == 0xff", pb[2] == 0xff);
  ;
  assertTrue("pb[3] == 0x7f", pb[3] == 0x7f);
  ;
  assertTrue("pb[4] == 0x00", pb[4] == 0x00);
  ;
  assertTrue("pb[5] == 0x80", pb[5] == 0x80);
  ;
  assertTrue("pb[6] == 0x80", pb[6] == 0x80);
  ;
  assertTrue("pb[7] == 0x00", pb[7] == 0x00);
  ;
  pb[0] = 0xCC;
  pb[3] = 0x00;
  assertTrue("pb[0] == 204", pb[0] == 204);
  ;
  assertTrue("pb[1] == 254", pb[1] == 254);
  ;
  uint8_t bytes[8] = {0xbb, 0xfe, 0xff, 0x7f, 0x00, 0x80, 0x80, 0x00};
  int16_t *ps = &bytes[0];
  assertTrue("ps[0] == -325", ps[0] == -325);
  ;
  assertTrue("ps[1] == 32767", ps[1] == 32767);
  ;
  assertTrue("ps[2] == -32768", ps[2] == -32768);
  ;
  assertTrue("ps[3] == 128", ps[3] == 128);
  ;
  ps[0] = 204;
  ps[1] = -254;
  ps[1] = -254;
  assertTrue("bytes[0] == 0xCC", bytes[0] == 0xCC);
  ;
  assertTrue("bytes[1] == 0x00", bytes[1] == 0x00);
  ;
  assertTrue("bytes[2] == 0x02", bytes[2] == 0x02);
  ;
  assertTrue("bytes[3] == 0xff", bytes[3] == 0xff);
  ;
}


x86 assembly (clang, -O0):
<test_int16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0xfffffebb,-0x10(%rbp)
movl   $0x7fff,-0xc(%rbp)
movl   $0xffff8000,-0x8(%rbp)
movl   $0x80,-0x4(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpl   $0xbb,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xeab(%rip),%rdi
call   1030 <assertTrue@plt>
mov    -0x18(%rbp),%rax
cmpl   $0xfe,0x4(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe9a(%rip),%rdi
call   1030 <assertTrue@plt>
mov    -0x18(%rbp),%rax
cmpl   $0xff,0x8(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe89(%rip),%rdi
call   1030 <assertTrue@plt>
mov    -0x18(%rbp),%rax
cmpl   $0x7f,0xc(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe7b(%rip),%rdi
call   1030 <assertTrue@plt>
mov    -0x18(%rbp),%rax
cmpl   $0x0,0x10(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe6d(%rip),%rdi
call   1030 <assertTrue@plt>
mov    -0x18(%rbp),%rax
cmpl   $0x80,0x14(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe5c(%rip),%rdi
call   1030 <assertTrue@plt>
mov    -0x18(%rbp),%rax
cmpl   $0x80,0x18(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe4b(%rip),%rdi
call   1030 <assertTrue@plt>
mov    -0x18(%rbp),%rax
cmpl   $0x0,0x1c(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe3d(%rip),%rdi
call   1030 <assertTrue@plt>
mov    -0x18(%rbp),%rax
movl   $0xcc,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,0xc(%rax)
mov    -0x18(%rbp),%rax
cmpl   $0xcc,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe18(%rip),%rdi
call   1030 <assertTrue@plt>
mov    -0x18(%rbp),%rax
cmpl   $0xfe,0x4(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe06(%rip),%rdi
call   1030 <assertTrue@plt>
mov    0xe8d(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe8a(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xe87(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe84(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
cmpl   $0xfffffebb,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xdc1(%rip),%rdi
call   1030 <assertTrue@plt>
mov    -0x48(%rbp),%rax
cmpl   $0x7fff,0x4(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xdb0(%rip),%rdi
call   1030 <assertTrue@plt>
mov    -0x48(%rbp),%rax
cmpl   $0xffff8000,0x8(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xda0(%rip),%rdi
call   1030 <assertTrue@plt>
mov    -0x48(%rbp),%rax
cmpl   $0x80,0xc(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xd91(%rip),%rdi
call   1030 <assertTrue@plt>
mov    -0x48(%rbp),%rax
movl   $0xcc,(%rax)
mov    -0x48(%rbp),%rax
movl   $0xffffff02,0x4(%rax)
mov    -0x48(%rbp),%rax
movl   $0xffffff02,0x4(%rax)
cmpl   $0xcc,-0x40(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xd63(%rip),%rdi
call   1030 <assertTrue@plt>
cmpl   $0x0,-0x3c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xd5c(%rip),%rdi
call   1030 <assertTrue@plt>
cmpl   $0x2,-0x38(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xd55(%rip),%rdi
call   1030 <assertTrue@plt>
cmpl   $0xff,-0x34(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xd4b(%rip),%rdi
call   1030 <assertTrue@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_int16>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %esi,%esi
call   1030 <assertTrue@plt>
lea    0xee8(%rip),%rdi
xor    %esi,%esi
call   1030 <assertTrue@plt>
lea    0xee8(%rip),%rdi
xor    %esi,%esi
call   1030 <assertTrue@plt>
lea    0xee8(%rip),%rdi
xor    %esi,%esi
call   1030 <assertTrue@plt>
lea    0xee8(%rip),%rdi
call   1030 <assertTrue@plt>
lea    0xeea(%rip),%rdi
call   1030 <assertTrue@plt>
lea    0xeec(%rip),%rdi
call   1030 <assertTrue@plt>
lea    0xeee(%rip),%rdi
call   1030 <assertTrue@plt>
lea    0xef0(%rip),%rdi
mov    $0x1,%esi
call   1030 <assertTrue@plt>
lea    0xeec(%rip),%rdi
xor    %esi,%esi
call   1030 <assertTrue@plt>
lea    0xeeb(%rip),%rdi
xor    %esi,%esi
call   1030 <assertTrue@plt>
lea    0xeeb(%rip),%rdi
xor    %esi,%esi
call   1030 <assertTrue@plt>
lea    0xeec(%rip),%rdi
xor    %esi,%esi
call   1030 <assertTrue@plt>
lea    0xeee(%rip),%rdi
xor    %esi,%esi
call   1030 <assertTrue@plt>
lea    0xeed(%rip),%rdi
mov    $0x1,%esi
call   1030 <assertTrue@plt>
lea    0xeed(%rip),%rdi
xor    %esi,%esi
call   1030 <assertTrue@plt>
lea    0xef0(%rip),%rdi
xor    %esi,%esi
call   1030 <assertTrue@plt>
lea    0xef3(%rip),%rdi
xor    %esi,%esi
pop    %rax
jmp    1030 <assertTrue@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"pb[0] == 0xbb\00"
@.str.1 = [14 x i8] c"pb[1] == 0xfe\00"
@.str.2 = [14 x i8] c"pb[2] == 0xff\00"
@.str.3 = [14 x i8] c"pb[3] == 0x7f\00"
@.str.4 = [14 x i8] c"pb[4] == 0x00\00"
@.str.5 = [14 x i8] c"pb[5] == 0x80\00"
@.str.6 = [14 x i8] c"pb[6] == 0x80\00"
@.str.7 = [14 x i8] c"pb[7] == 0x00\00"
@.str.8 = [13 x i8] c"pb[0] == 204\00"
@.str.9 = [13 x i8] c"pb[1] == 254\00"
@__const.test_int16.bytes = [8 x i32] [i32 187, i32 254, i32 255, i32 127, i32 0, i32 128, i32 128, i32 0]
@.str.10 = [14 x i8] c"ps[0] == -325\00"
@.str.11 = [15 x i8] c"ps[1] == 32767\00"
@.str.12 = [16 x i8] c"ps[2] == -32768\00"
@.str.13 = [13 x i8] c"ps[3] == 128\00"
@.str.14 = [17 x i8] c"bytes[0] == 0xCC\00"
@.str.15 = [17 x i8] c"bytes[1] == 0x00\00"
@.str.16 = [17 x i8] c"bytes[2] == 0x02\00"
@.str.17 = [17 x i8] c"bytes[3] == 0xff\00"
define void @test_int16() {
%1 = alloca [4 x i32]
%2 = alloca i32*
%3 = alloca [8 x i32]
%4 = alloca i32*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
store i32 -325, i32* %5
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 1
store i32 32767, i32* %6
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 2
store i32 -32768, i32* %7
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 3
store i32 128, i32* %8
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
store i32* %9, i32** %2
%10 = load i32*, i32** %2
%11 = getelementptr inbounds i32, i32* %10, i64 0
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 187
%14 = zext i1 %13 to i32
%15 = call i32 @assertTrue(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = load i32*, i32** %2
%17 = getelementptr inbounds i32, i32* %16, i64 1
%18 = load i32, i32* %17
%19 = icmp eq i32 %18, 254
%20 = zext i1 %19 to i32
%21 = call i32 @assertTrue(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %20)
%22 = load i32*, i32** %2
%23 = getelementptr inbounds i32, i32* %22, i64 2
%24 = load i32, i32* %23
%25 = icmp eq i32 %24, 255
%26 = zext i1 %25 to i32
%27 = call i32 @assertTrue(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %26)
%28 = load i32*, i32** %2
%29 = getelementptr inbounds i32, i32* %28, i64 3
%30 = load i32, i32* %29
%31 = icmp eq i32 %30, 127
%32 = zext i1 %31 to i32
%33 = call i32 @assertTrue(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %32)
%34 = load i32*, i32** %2
%35 = getelementptr inbounds i32, i32* %34, i64 4
%36 = load i32, i32* %35
%37 = icmp eq i32 %36, 0
%38 = zext i1 %37 to i32
%39 = call i32 @assertTrue(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %38)
%40 = load i32*, i32** %2
%41 = getelementptr inbounds i32, i32* %40, i64 5
%42 = load i32, i32* %41
%43 = icmp eq i32 %42, 128
%44 = zext i1 %43 to i32
%45 = call i32 @assertTrue(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 %44)
%46 = load i32*, i32** %2
%47 = getelementptr inbounds i32, i32* %46, i64 6
%48 = load i32, i32* %47
%49 = icmp eq i32 %48, 128
%50 = zext i1 %49 to i32
%51 = call i32 @assertTrue(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 %50)
%52 = load i32*, i32** %2
%53 = getelementptr inbounds i32, i32* %52, i64 7
%54 = load i32, i32* %53
%55 = icmp eq i32 %54, 0
%56 = zext i1 %55 to i32
%57 = call i32 @assertTrue(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i32 %56)
%58 = load i32*, i32** %2
%59 = getelementptr inbounds i32, i32* %58, i64 0
store i32 204, i32* %59
%60 = load i32*, i32** %2
%61 = getelementptr inbounds i32, i32* %60, i64 3
store i32 0, i32* %61
%62 = load i32*, i32** %2
%63 = getelementptr inbounds i32, i32* %62, i64 0
%64 = load i32, i32* %63
%65 = icmp eq i32 %64, 204
%66 = zext i1 %65 to i32
%67 = call i32 @assertTrue(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 %66)
%68 = load i32*, i32** %2
%69 = getelementptr inbounds i32, i32* %68, i64 1
%70 = load i32, i32* %69
%71 = icmp eq i32 %70, 254
%72 = zext i1 %71 to i32
%73 = call i32 @assertTrue(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i32 %72)
%74 = bitcast [8 x i32]* %3 to i8*
%75 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
store i32* %75, i32** %4
%76 = load i32*, i32** %4
%77 = getelementptr inbounds i32, i32* %76, i64 0
%78 = load i32, i32* %77
%79 = icmp eq i32 %78, -325
%80 = zext i1 %79 to i32
%81 = call i32 @assertTrue(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i32 %80)
%82 = load i32*, i32** %4
%83 = getelementptr inbounds i32, i32* %82, i64 1
%84 = load i32, i32* %83
%85 = icmp eq i32 %84, 32767
%86 = zext i1 %85 to i32
%87 = call i32 @assertTrue(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.11, i64 0, i64 0), i32 %86)
%88 = load i32*, i32** %4
%89 = getelementptr inbounds i32, i32* %88, i64 2
%90 = load i32, i32* %89
%91 = icmp eq i32 %90, -32768
%92 = zext i1 %91 to i32
%93 = call i32 @assertTrue(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.12, i64 0, i64 0), i32 %92)
%94 = load i32*, i32** %4
%95 = getelementptr inbounds i32, i32* %94, i64 3
%96 = load i32, i32* %95
%97 = icmp eq i32 %96, 128
%98 = zext i1 %97 to i32
%99 = call i32 @assertTrue(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0), i32 %98)
%100 = load i32*, i32** %4
%101 = getelementptr inbounds i32, i32* %100, i64 0
store i32 204, i32* %101
%102 = load i32*, i32** %4
%103 = getelementptr inbounds i32, i32* %102, i64 1
store i32 -254, i32* %103
%104 = load i32*, i32** %4
%105 = getelementptr inbounds i32, i32* %104, i64 1
store i32 -254, i32* %105
%106 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%107 = load i32, i32* %106
%108 = icmp eq i32 %107, 204
%109 = zext i1 %108 to i32
%110 = call i32 @assertTrue(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0), i32 %109)
%111 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 1
%112 = load i32, i32* %111
%113 = icmp eq i32 %112, 0
%114 = zext i1 %113 to i32
%115 = call i32 @assertTrue(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.15, i64 0, i64 0), i32 %114)
%116 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 2
%117 = load i32, i32* %116
%118 = icmp eq i32 %117, 2
%119 = zext i1 %118 to i32
%120 = call i32 @assertTrue(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.16, i64 0, i64 0), i32 %119)
%121 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 3
%122 = load i32, i32* %121
%123 = icmp eq i32 %122, 255
%124 = zext i1 %123 to i32
%125 = call i32 @assertTrue(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.17, i64 0, i64 0), i32 %124)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"pb[0] == 0xbb\00"
@.str.1 = [14 x i8] c"pb[1] == 0xfe\00"
@.str.2 = [14 x i8] c"pb[2] == 0xff\00"
@.str.3 = [14 x i8] c"pb[3] == 0x7f\00"
@.str.4 = [14 x i8] c"pb[4] == 0x00\00"
@.str.5 = [14 x i8] c"pb[5] == 0x80\00"
@.str.6 = [14 x i8] c"pb[6] == 0x80\00"
@.str.7 = [14 x i8] c"pb[7] == 0x00\00"
@.str.8 = [13 x i8] c"pb[0] == 204\00"
@.str.9 = [13 x i8] c"pb[1] == 254\00"
@.str.10 = [14 x i8] c"ps[0] == -325\00"
@.str.11 = [15 x i8] c"ps[1] == 32767\00"
@.str.12 = [16 x i8] c"ps[2] == -32768\00"
@.str.13 = [13 x i8] c"ps[3] == 128\00"
@.str.14 = [17 x i8] c"bytes[0] == 0xCC\00"
@.str.15 = [17 x i8] c"bytes[1] == 0x00\00"
@.str.16 = [17 x i8] c"bytes[2] == 0x02\00"
@.str.17 = [17 x i8] c"bytes[3] == 0xff\00"
define void @test_int16() {
%1 = tail call i32 @assertTrue(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @assertTrue(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 0)
%3 = tail call i32 @assertTrue(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 0)
%4 = tail call i32 @assertTrue(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 0)
%5 = tail call i32 @assertTrue(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 poison)
%6 = tail call i32 @assertTrue(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 poison)
%7 = tail call i32 @assertTrue(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 poison)
%8 = tail call i32 @assertTrue(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i32 poison)
%9 = tail call i32 @assertTrue(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 1)
%10 = tail call i32 @assertTrue(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i32 0)
%11 = tail call i32 @assertTrue(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i32 0)
%12 = tail call i32 @assertTrue(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.11, i64 0, i64 0), i32 0)
%13 = tail call i32 @assertTrue(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.12, i64 0, i64 0), i32 0)
%14 = tail call i32 @assertTrue(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0), i32 0)
%15 = tail call i32 @assertTrue(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0), i32 1)
%16 = tail call i32 @assertTrue(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.15, i64 0, i64 0), i32 0)
%17 = tail call i32 @assertTrue(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.16, i64 0, i64 0), i32 0)
%18 = tail call i32 @assertTrue(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.17, i64 0, i64 0), i32 0)
ret void
}