unsigned long assemble_16(x, y)
unsigned int x, y;
{
  unsigned int temp;
  if ((0)) {
    temp = ((((((((y) >> (31 - (13)) & ((1 << ((13) - (13) + 1)) - 1)) &
                 (~((-1) << 1)))
                << 1) |
               ((((y) >> (31 - (13)) & ((1 << ((13) - (13) + 1)) - 1)) ^
                 ((x) >> (31 - (0)) & ((1 << ((0) - (0) + 1)) - 1))) &
                (~((-1) << 1)))) &
              (~((-1) << 2)))
             << 14) |
            (((((((y) >> (31 - (13)) & ((1 << ((13) - (13) + 1)) - 1)) ^
                 ((x) >> (31 - (1)) & ((1 << ((1) - (1) + 1)) - 1))) &
                (~((-1) << 1)))
               << 13) |
              (((y) >> (31 - (12)) & ((1 << ((12) - (0) + 1)) - 1)) &
               (~((-1) << 13)))) &
             (~((-1) << 14))));
  } else {
    temp = ((((((((y) >> (31 - (13)) & ((1 << ((13) - (13) + 1)) - 1)) &
                 (~((-1) << 1)))
                << 1) |
               (((y) >> (31 - (13)) & ((1 << ((13) - (13) + 1)) - 1)) &
                (~((-1) << 1)))) &
              (~((-1) << 2)))
             << 14) |
            ((((((y) >> (31 - (13)) & ((1 << ((13) - (13) + 1)) - 1)) &
                (~((-1) << 1)))
               << 13) |
              (((y) >> (31 - (12)) & ((1 << ((12) - (0) + 1)) - 1)) &
               (~((-1) << 13)))) &
             (~((-1) << 14))));
  }
  return sign_extend(temp, 16);
}


x86 assembly (clang, -O0):
<assemble_16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x12,%eax
and    $0x1,%eax
and    $0x1,%eax
shl    $0x1,%eax
mov    -0x8(%rbp),%ecx
shr    $0x12,%ecx
and    $0x1,%ecx
and    $0x1,%ecx
or     %ecx,%eax
and    $0x3,%eax
shl    $0xe,%eax
mov    -0x8(%rbp),%ecx
shr    $0x12,%ecx
and    $0x1,%ecx
and    $0x1,%ecx
shl    $0xd,%ecx
mov    -0x8(%rbp),%edx
shr    $0x13,%edx
and    $0x1fff,%edx
and    $0x1fff,%edx
or     %edx,%ecx
and    $0x3fff,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x10,%esi
mov    $0x0,%al
call   1030 <sign_extend@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assemble_16>:
push   %rax
mov    %esi,%edi
shr    $0x12,%edi
mov    %edi,%eax
and    $0x1,%eax
shld   $0xd,%esi,%edi
shr    $0x11,%esi
and    $0x2,%esi
or     %esi,%eax
shl    $0xe,%eax
and    $0x3fff,%edi
or     %eax,%edi
mov    $0x10,%esi
xor    %eax,%eax
call   1030 <sign_extend@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @assemble_16(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = lshr i32 %6, 18
%8 = and i32 %7, 1
%9 = and i32 %8, 1
%10 = shl i32 %9, 1
%11 = load i32, i32* %4
%12 = lshr i32 %11, 18
%13 = and i32 %12, 1
%14 = and i32 %13, 1
%15 = or i32 %10, %14
%16 = and i32 %15, 3
%17 = shl i32 %16, 14
%18 = load i32, i32* %4
%19 = lshr i32 %18, 18
%20 = and i32 %19, 1
%21 = and i32 %20, 1
%22 = shl i32 %21, 13
%23 = load i32, i32* %4
%24 = lshr i32 %23, 19
%25 = and i32 %24, 8191
%26 = and i32 %25, 8191
%27 = or i32 %22, %26
%28 = and i32 %27, 16383
%29 = or i32 %17, %28
store i32 %29, i32* %5
%30 = load i32, i32* %5
%31 = call i32 (i32, i32, ...) bitcast (i32 (...)* @sign_extend to i32 (i32, i32, ...)*)(i32 %30, i32 16)
%32 = sext i32 %31 to i64
ret i64 %32
}

LLVM IR (-O2):
define i64 @assemble_16(i32 %0, i32 %1) {
%3 = lshr i32 %1, 18
%4 = and i32 %3, 1
%5 = shl nuw nsw i32 %3, 1
%6 = and i32 %5, 2
%7 = or i32 %6, %4
%8 = shl nuw nsw i32 %7, 14
%9 = tail call i32 @llvm.fshl.i32(i32 %3, i32 %1, i32 13)
%10 = and i32 %9, 16383
%11 = or i32 %8, %10
%12 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @sign_extend to i32 (i32, i32, ...)*)(i32 %11, i32 16)
%13 = sext i32 %12 to i64
ret i64 %13
}