#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*/ set_b(int);
void send_short(unsigned short t) {
  set_b(!!(t & (0x8000)));
  set_b(!!(t & (0x4000)));
  set_b(!!(t & (0x2000)));
  set_b(!!(t & (0x1000)));
  set_b(!!(t & (0x0800)));
  set_b(!!(t & (0x0400)));
  set_b(!!(t & (0x0200)));
  set_b(!!(t & (0x0100)));
  set_b(!!(t & (0x0080)));
  set_b(!!(t & (0x0040)));
  set_b(!!(t & (0x0020)));
  set_b(!!(t & (0x0010)));
  set_b(!!(t & (0x0008)));
  set_b(!!(t & (0x0004)));
  set_b(!!(t & (0x0002)));
  set_b(!!(t & (0x0001)));
}


x86 assembly (clang, -O0):
<send_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0x8000,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <set_b@plt>
movzwl -0x2(%rbp),%eax
and    $0x4000,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <set_b@plt>
movzwl -0x2(%rbp),%eax
and    $0x2000,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <set_b@plt>
movzwl -0x2(%rbp),%eax
and    $0x1000,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <set_b@plt>
movzwl -0x2(%rbp),%eax
and    $0x800,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <set_b@plt>
movzwl -0x2(%rbp),%eax
and    $0x400,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <set_b@plt>
movzwl -0x2(%rbp),%eax
and    $0x200,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <set_b@plt>
movzwl -0x2(%rbp),%eax
and    $0x100,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <set_b@plt>
movzwl -0x2(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <set_b@plt>
movzwl -0x2(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <set_b@plt>
movzwl -0x2(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <set_b@plt>
movzwl -0x2(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <set_b@plt>
movzwl -0x2(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <set_b@plt>
movzwl -0x2(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <set_b@plt>
movzwl -0x2(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <set_b@plt>
movzwl -0x2(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <set_b@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_short>:
push   %rbx
mov    %edi,%ebx
shr    $0xf,%edi
call   1030 <set_b@plt>
mov    %ebx,%edi
shr    $0xe,%edi
and    $0x1,%edi
call   1030 <set_b@plt>
mov    %ebx,%edi
shr    $0xd,%edi
and    $0x1,%edi
call   1030 <set_b@plt>
mov    %ebx,%edi
shr    $0xc,%edi
and    $0x1,%edi
call   1030 <set_b@plt>
mov    %ebx,%edi
shr    $0xb,%edi
and    $0x1,%edi
call   1030 <set_b@plt>
mov    %ebx,%edi
shr    $0xa,%edi
and    $0x1,%edi
call   1030 <set_b@plt>
mov    %ebx,%edi
shr    $0x9,%edi
and    $0x1,%edi
call   1030 <set_b@plt>
mov    %ebx,%edi
shr    $0x8,%edi
and    $0x1,%edi
call   1030 <set_b@plt>
mov    %ebx,%edi
shr    $0x7,%edi
and    $0x1,%edi
call   1030 <set_b@plt>
mov    %ebx,%edi
shr    $0x6,%edi
and    $0x1,%edi
call   1030 <set_b@plt>
mov    %ebx,%edi
shr    $0x5,%edi
and    $0x1,%edi
call   1030 <set_b@plt>
mov    %ebx,%edi
shr    $0x4,%edi
and    $0x1,%edi
call   1030 <set_b@plt>
mov    %ebx,%edi
shr    $0x3,%edi
and    $0x1,%edi
call   1030 <set_b@plt>
mov    %ebx,%edi
shr    $0x2,%edi
and    $0x1,%edi
call   1030 <set_b@plt>
mov    %ebx,%edi
shr    %edi
and    $0x1,%edi
call   1030 <set_b@plt>
and    $0x1,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <set_b@plt>

LLVM IR (-O0):
define void @send_short(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 32768
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
%10 = call i32 @set_b(i32 %9)
%11 = load i16, i16* %2
%12 = zext i16 %11 to i32
%13 = and i32 %12, 16384
%14 = icmp ne i32 %13, 0
%15 = xor i1 %14, true
%16 = xor i1 %15, true
%17 = zext i1 %16 to i32
%18 = call i32 @set_b(i32 %17)
%19 = load i16, i16* %2
%20 = zext i16 %19 to i32
%21 = and i32 %20, 8192
%22 = icmp ne i32 %21, 0
%23 = xor i1 %22, true
%24 = xor i1 %23, true
%25 = zext i1 %24 to i32
%26 = call i32 @set_b(i32 %25)
%27 = load i16, i16* %2
%28 = zext i16 %27 to i32
%29 = and i32 %28, 4096
%30 = icmp ne i32 %29, 0
%31 = xor i1 %30, true
%32 = xor i1 %31, true
%33 = zext i1 %32 to i32
%34 = call i32 @set_b(i32 %33)
%35 = load i16, i16* %2
%36 = zext i16 %35 to i32
%37 = and i32 %36, 2048
%38 = icmp ne i32 %37, 0
%39 = xor i1 %38, true
%40 = xor i1 %39, true
%41 = zext i1 %40 to i32
%42 = call i32 @set_b(i32 %41)
%43 = load i16, i16* %2
%44 = zext i16 %43 to i32
%45 = and i32 %44, 1024
%46 = icmp ne i32 %45, 0
%47 = xor i1 %46, true
%48 = xor i1 %47, true
%49 = zext i1 %48 to i32
%50 = call i32 @set_b(i32 %49)
%51 = load i16, i16* %2
%52 = zext i16 %51 to i32
%53 = and i32 %52, 512
%54 = icmp ne i32 %53, 0
%55 = xor i1 %54, true
%56 = xor i1 %55, true
%57 = zext i1 %56 to i32
%58 = call i32 @set_b(i32 %57)
%59 = load i16, i16* %2
%60 = zext i16 %59 to i32
%61 = and i32 %60, 256
%62 = icmp ne i32 %61, 0
%63 = xor i1 %62, true
%64 = xor i1 %63, true
%65 = zext i1 %64 to i32
%66 = call i32 @set_b(i32 %65)
%67 = load i16, i16* %2
%68 = zext i16 %67 to i32
%69 = and i32 %68, 128
%70 = icmp ne i32 %69, 0
%71 = xor i1 %70, true
%72 = xor i1 %71, true
%73 = zext i1 %72 to i32
%74 = call i32 @set_b(i32 %73)
%75 = load i16, i16* %2
%76 = zext i16 %75 to i32
%77 = and i32 %76, 64
%78 = icmp ne i32 %77, 0
%79 = xor i1 %78, true
%80 = xor i1 %79, true
%81 = zext i1 %80 to i32
%82 = call i32 @set_b(i32 %81)
%83 = load i16, i16* %2
%84 = zext i16 %83 to i32
%85 = and i32 %84, 32
%86 = icmp ne i32 %85, 0
%87 = xor i1 %86, true
%88 = xor i1 %87, true
%89 = zext i1 %88 to i32
%90 = call i32 @set_b(i32 %89)
%91 = load i16, i16* %2
%92 = zext i16 %91 to i32
%93 = and i32 %92, 16
%94 = icmp ne i32 %93, 0
%95 = xor i1 %94, true
%96 = xor i1 %95, true
%97 = zext i1 %96 to i32
%98 = call i32 @set_b(i32 %97)
%99 = load i16, i16* %2
%100 = zext i16 %99 to i32
%101 = and i32 %100, 8
%102 = icmp ne i32 %101, 0
%103 = xor i1 %102, true
%104 = xor i1 %103, true
%105 = zext i1 %104 to i32
%106 = call i32 @set_b(i32 %105)
%107 = load i16, i16* %2
%108 = zext i16 %107 to i32
%109 = and i32 %108, 4
%110 = icmp ne i32 %109, 0
%111 = xor i1 %110, true
%112 = xor i1 %111, true
%113 = zext i1 %112 to i32
%114 = call i32 @set_b(i32 %113)
%115 = load i16, i16* %2
%116 = zext i16 %115 to i32
%117 = and i32 %116, 2
%118 = icmp ne i32 %117, 0
%119 = xor i1 %118, true
%120 = xor i1 %119, true
%121 = zext i1 %120 to i32
%122 = call i32 @set_b(i32 %121)
%123 = load i16, i16* %2
%124 = zext i16 %123 to i32
%125 = and i32 %124, 1
%126 = icmp ne i32 %125, 0
%127 = xor i1 %126, true
%128 = xor i1 %127, true
%129 = zext i1 %128 to i32
%130 = call i32 @set_b(i32 %129)
ret void
}

LLVM IR (-O2):
define void @send_short(i16 zeroext %0) {
%2 = zext i16 %0 to i32
%3 = lshr i32 %2, 15
%4 = tail call i32 @set_b(i32 %3)
%5 = lshr i32 %2, 14
%6 = and i32 %5, 1
%7 = tail call i32 @set_b(i32 %6)
%8 = lshr i32 %2, 13
%9 = and i32 %8, 1
%10 = tail call i32 @set_b(i32 %9)
%11 = lshr i32 %2, 12
%12 = and i32 %11, 1
%13 = tail call i32 @set_b(i32 %12)
%14 = lshr i32 %2, 11
%15 = and i32 %14, 1
%16 = tail call i32 @set_b(i32 %15)
%17 = lshr i32 %2, 10
%18 = and i32 %17, 1
%19 = tail call i32 @set_b(i32 %18)
%20 = lshr i32 %2, 9
%21 = and i32 %20, 1
%22 = tail call i32 @set_b(i32 %21)
%23 = lshr i32 %2, 8
%24 = and i32 %23, 1
%25 = tail call i32 @set_b(i32 %24)
%26 = lshr i32 %2, 7
%27 = and i32 %26, 1
%28 = tail call i32 @set_b(i32 %27)
%29 = lshr i32 %2, 6
%30 = and i32 %29, 1
%31 = tail call i32 @set_b(i32 %30)
%32 = lshr i32 %2, 5
%33 = and i32 %32, 1
%34 = tail call i32 @set_b(i32 %33)
%35 = lshr i32 %2, 4
%36 = and i32 %35, 1
%37 = tail call i32 @set_b(i32 %36)
%38 = lshr i32 %2, 3
%39 = and i32 %38, 1
%40 = tail call i32 @set_b(i32 %39)
%41 = lshr i32 %2, 2
%42 = and i32 %41, 1
%43 = tail call i32 @set_b(i32 %42)
%44 = lshr i32 %2, 1
%45 = and i32 %44, 1
%46 = tail call i32 @set_b(i32 %45)
%47 = and i32 %2, 1
%48 = tail call i32 @set_b(i32 %47)
ret void
}