int main() {
  signed char a, b;
  signed short int c;
  a = 0x02;
  b = 0x04;
  c = (signed short int)(a) * (signed short int)(b);
  c = 0;
  a = 0xFF;
  b = 0xFF;
  c = (signed short int)(a) * (signed short int)(b);
  c = 0;
  a = 0xFF;
  b = 0x01;
  c = (signed short int)(a) * (signed short int)(b);
  c = 0;
  a = 0xFF;
  b = 0x0A;
  c = (signed short int)(a) * (signed short int)(b);
  c = 0;
  a = 0xFE;
  b = 0xFC;
  c = (signed short int)(a) * (signed short int)(b);
  c = 0;
  a = 0x0A;
  b = 0x0B;
  c = (signed short int)(a) * (signed short int)(b);
  c = 0;
  a = 0xF6;
  b = 0x0B;
  c = (signed short int)(a) * (signed short int)(b);
  c = 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x2,-0x5(%rbp)
movb   $0x4,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
cwtl
movsbl -0x6(%rbp),%ecx
movswl %cx,%ecx
imul   %ecx,%eax
mov    %ax,-0x8(%rbp)
movw   $0x0,-0x8(%rbp)
movb   $0xff,-0x5(%rbp)
movb   $0xff,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
cwtl
movsbl -0x6(%rbp),%ecx
movswl %cx,%ecx
imul   %ecx,%eax
mov    %ax,-0x8(%rbp)
movw   $0x0,-0x8(%rbp)
movb   $0xff,-0x5(%rbp)
movb   $0x1,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
cwtl
movsbl -0x6(%rbp),%ecx
movswl %cx,%ecx
imul   %ecx,%eax
mov    %ax,-0x8(%rbp)
movw   $0x0,-0x8(%rbp)
movb   $0xff,-0x5(%rbp)
movb   $0xa,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
cwtl
movsbl -0x6(%rbp),%ecx
movswl %cx,%ecx
imul   %ecx,%eax
mov    %ax,-0x8(%rbp)
movw   $0x0,-0x8(%rbp)
movb   $0xfe,-0x5(%rbp)
movb   $0xfc,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
cwtl
movsbl -0x6(%rbp),%ecx
movswl %cx,%ecx
imul   %ecx,%eax
mov    %ax,-0x8(%rbp)
movw   $0x0,-0x8(%rbp)
movb   $0xa,-0x5(%rbp)
movb   $0xb,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
cwtl
movsbl -0x6(%rbp),%ecx
movswl %cx,%ecx
imul   %ecx,%eax
mov    %ax,-0x8(%rbp)
movw   $0x0,-0x8(%rbp)
movb   $0xf6,-0x5(%rbp)
movb   $0xb,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
cwtl
movsbl -0x6(%rbp),%ecx
movswl %cx,%ecx
imul   %ecx,%eax
mov    %ax,-0x8(%rbp)
movw   $0x0,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i16
store i32 0, i32* %1
store i8 2, i8* %2
store i8 4, i8* %3
%5 = load i8, i8* %2
%6 = sext i8 %5 to i16
%7 = sext i16 %6 to i32
%8 = load i8, i8* %3
%9 = sext i8 %8 to i16
%10 = sext i16 %9 to i32
%11 = mul nsw i32 %7, %10
%12 = trunc i32 %11 to i16
store i16 %12, i16* %4
store i16 0, i16* %4
store i8 -1, i8* %2
store i8 -1, i8* %3
%13 = load i8, i8* %2
%14 = sext i8 %13 to i16
%15 = sext i16 %14 to i32
%16 = load i8, i8* %3
%17 = sext i8 %16 to i16
%18 = sext i16 %17 to i32
%19 = mul nsw i32 %15, %18
%20 = trunc i32 %19 to i16
store i16 %20, i16* %4
store i16 0, i16* %4
store i8 -1, i8* %2
store i8 1, i8* %3
%21 = load i8, i8* %2
%22 = sext i8 %21 to i16
%23 = sext i16 %22 to i32
%24 = load i8, i8* %3
%25 = sext i8 %24 to i16
%26 = sext i16 %25 to i32
%27 = mul nsw i32 %23, %26
%28 = trunc i32 %27 to i16
store i16 %28, i16* %4
store i16 0, i16* %4
store i8 -1, i8* %2
store i8 10, i8* %3
%29 = load i8, i8* %2
%30 = sext i8 %29 to i16
%31 = sext i16 %30 to i32
%32 = load i8, i8* %3
%33 = sext i8 %32 to i16
%34 = sext i16 %33 to i32
%35 = mul nsw i32 %31, %34
%36 = trunc i32 %35 to i16
store i16 %36, i16* %4
store i16 0, i16* %4
store i8 -2, i8* %2
store i8 -4, i8* %3
%37 = load i8, i8* %2
%38 = sext i8 %37 to i16
%39 = sext i16 %38 to i32
%40 = load i8, i8* %3
%41 = sext i8 %40 to i16
%42 = sext i16 %41 to i32
%43 = mul nsw i32 %39, %42
%44 = trunc i32 %43 to i16
store i16 %44, i16* %4
store i16 0, i16* %4
store i8 10, i8* %2
store i8 11, i8* %3
%45 = load i8, i8* %2
%46 = sext i8 %45 to i16
%47 = sext i16 %46 to i32
%48 = load i8, i8* %3
%49 = sext i8 %48 to i16
%50 = sext i16 %49 to i32
%51 = mul nsw i32 %47, %50
%52 = trunc i32 %51 to i16
store i16 %52, i16* %4
store i16 0, i16* %4
store i8 -10, i8* %2
store i8 11, i8* %3
%53 = load i8, i8* %2
%54 = sext i8 %53 to i16
%55 = sext i16 %54 to i32
%56 = load i8, i8* %3
%57 = sext i8 %56 to i16
%58 = sext i16 %57 to i32
%59 = mul nsw i32 %55, %58
%60 = trunc i32 %59 to i16
store i16 %60, i16* %4
store i16 0, i16* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}