#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*/ print(char *);
int /*<<< orphan*/ printd(int);
int /*<<< orphan*/ prints(short);
void main() {
  short s;
  char c;
  c = 255;
  s = (short)c * 64;
  prints((short)64);
  print("\r\n");
  prints((short)c);
  print("\r\n");
  prints(s);
  print("\r\n");
  printd((int)(s >> 8));
  print("\r\n");
  printd((int)s);
  print("\r\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0xff,-0x3(%rbp)
movsbl -0x3(%rbp),%eax
cwtl
shl    $0x6,%eax
mov    %ax,-0x2(%rbp)
mov    $0x40,%edi
call   1050 <prints@plt>
lea    0xea7(%rip),%rdi
call   1040 <print@plt>
movsbl -0x3(%rbp),%eax
movswl %ax,%edi
call   1050 <prints@plt>
lea    0xe8f(%rip),%rdi
call   1040 <print@plt>
movswl -0x2(%rbp),%edi
call   1050 <prints@plt>
lea    0xe7a(%rip),%rdi
call   1040 <print@plt>
movswl -0x2(%rbp),%edi
sar    $0x8,%edi
call   1030 <printd@plt>
lea    0xe62(%rip),%rdi
call   1040 <print@plt>
movswl -0x2(%rbp),%edi
call   1030 <printd@plt>
lea    0xe4d(%rip),%rdi
call   1040 <print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x40,%edi
call   1050 <prints@plt>
lea    0xebe(%rip),%rbx
mov    %rbx,%rdi
call   1040 <print@plt>
mov    $0xffffffff,%edi
call   1050 <prints@plt>
mov    %rbx,%rdi
call   1040 <print@plt>
mov    $0xffffffc0,%edi
call   1050 <prints@plt>
mov    %rbx,%rdi
call   1040 <print@plt>
mov    $0xffffffff,%edi
call   1030 <printd@plt>
mov    %rbx,%rdi
call   1040 <print@plt>
mov    $0xffffffc0,%edi
call   1030 <printd@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <print@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\0D\0A\00"
define void @main() {
%1 = alloca i16
%2 = alloca i8
store i8 -1, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i16
%5 = sext i16 %4 to i32
%6 = mul nsw i32 %5, 64
%7 = trunc i32 %6 to i16
store i16 %7, i16* %1
%8 = call i32 @prints(i16 signext 64)
%9 = call i32 @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = load i8, i8* %2
%11 = sext i8 %10 to i16
%12 = call i32 @prints(i16 signext %11)
%13 = call i32 @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%14 = load i16, i16* %1
%15 = call i32 @prints(i16 signext %14)
%16 = call i32 @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%17 = load i16, i16* %1
%18 = sext i16 %17 to i32
%19 = ashr i32 %18, 8
%20 = call i32 @printd(i32 %19)
%21 = call i32 @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%22 = load i16, i16* %1
%23 = sext i16 %22 to i32
%24 = call i32 @printd(i32 %23)
%25 = call i32 @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define void @main() {
%1 = tail call i32 @prints(i16 signext 64)
%2 = tail call i32 @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @prints(i16 signext -1)
%4 = tail call i32 @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @prints(i16 signext -64)
%6 = tail call i32 @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @printd(i32 -1)
%8 = tail call i32 @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @printd(i32 -64)
%10 = tail call i32 @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}