int main() {
  unsigned short int a, b, c;
  a = 0xFFFF;
  b = 0x0001;
  c = a / b;
  c = 0;
  a = 0x000F;
  b = 0x0003;
  c = a / b;
  c = 0;
  a = 0xAAAA;
  b = 0x5555;
  c = a / b;
  c = 0;
  a = 0x7FFF;
  b = 0xFFFF;
  c = a / b;
  c = 0;
  a = 0x0000;
  b = 0x8000;
  c = a / b;
  c = 0;
  a = 0x0030;
  b = 0x0005;
  c = a / b;
  c = 0;
  a = 0xFFFF;
  b = 0xFFFF;
  c = a / b;
  c = 0;
  a = 0xFFFE;
  b = 0x0010;
  c = a / b;
  c = 0;
  a = 0x0020;
  b = 0xFFFE;
  c = a / b;
  c = 0;
  a = 0x0000;
  b = 0xFFFF;
  c = a / b;
  c = 0;
  a = 0x78;
  c = a / 5;
  c = c / 4;
  c = c / 3;
  c = c / 2;
  c = 0;
  a = 0x10;
  c = a / 0xFFFF;
  c = 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movw   $0xffff,-0x6(%rbp)
movw   $0x1,-0x8(%rbp)
movzwl -0x6(%rbp),%eax
movzwl -0x8(%rbp),%ecx
cltd
idiv   %ecx
mov    %ax,-0xa(%rbp)
movw   $0x0,-0xa(%rbp)
movw   $0xf,-0x6(%rbp)
movw   $0x3,-0x8(%rbp)
movzwl -0x6(%rbp),%eax
movzwl -0x8(%rbp),%ecx
cltd
idiv   %ecx
mov    %ax,-0xa(%rbp)
movw   $0x0,-0xa(%rbp)
movw   $0xaaaa,-0x6(%rbp)
movw   $0x5555,-0x8(%rbp)
movzwl -0x6(%rbp),%eax
movzwl -0x8(%rbp),%ecx
cltd
idiv   %ecx
mov    %ax,-0xa(%rbp)
movw   $0x0,-0xa(%rbp)
movw   $0x7fff,-0x6(%rbp)
movw   $0xffff,-0x8(%rbp)
movzwl -0x6(%rbp),%eax
movzwl -0x8(%rbp),%ecx
cltd
idiv   %ecx
mov    %ax,-0xa(%rbp)
movw   $0x0,-0xa(%rbp)
movw   $0x0,-0x6(%rbp)
movw   $0x8000,-0x8(%rbp)
movzwl -0x6(%rbp),%eax
movzwl -0x8(%rbp),%ecx
cltd
idiv   %ecx
mov    %ax,-0xa(%rbp)
movw   $0x0,-0xa(%rbp)
movw   $0x30,-0x6(%rbp)
movw   $0x5,-0x8(%rbp)
movzwl -0x6(%rbp),%eax
movzwl -0x8(%rbp),%ecx
cltd
idiv   %ecx
mov    %ax,-0xa(%rbp)
movw   $0x0,-0xa(%rbp)
movw   $0xffff,-0x6(%rbp)
movw   $0xffff,-0x8(%rbp)
movzwl -0x6(%rbp),%eax
movzwl -0x8(%rbp),%ecx
cltd
idiv   %ecx
mov    %ax,-0xa(%rbp)
movw   $0x0,-0xa(%rbp)
movw   $0xfffe,-0x6(%rbp)
movw   $0x10,-0x8(%rbp)
movzwl -0x6(%rbp),%eax
movzwl -0x8(%rbp),%ecx
cltd
idiv   %ecx
mov    %ax,-0xa(%rbp)
movw   $0x0,-0xa(%rbp)
movw   $0x20,-0x6(%rbp)
movw   $0xfffe,-0x8(%rbp)
movzwl -0x6(%rbp),%eax
movzwl -0x8(%rbp),%ecx
cltd
idiv   %ecx
mov    %ax,-0xa(%rbp)
movw   $0x0,-0xa(%rbp)
movw   $0x0,-0x6(%rbp)
movw   $0xffff,-0x8(%rbp)
movzwl -0x6(%rbp),%eax
movzwl -0x8(%rbp),%ecx
cltd
idiv   %ecx
mov    %ax,-0xa(%rbp)
movw   $0x0,-0xa(%rbp)
movw   $0x78,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %ax,-0xa(%rbp)
movw   $0x0,-0xa(%rbp)
movw   $0x10,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
mov    $0xffff,%ecx
cltd
idiv   %ecx
mov    %ax,-0xa(%rbp)
movw   $0x0,-0xa(%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 i16
%3 = alloca i16
%4 = alloca i16
store i32 0, i32* %1
store i16 -1, i16* %2
store i16 1, i16* %3
%5 = load i16, i16* %2
%6 = zext i16 %5 to i32
%7 = load i16, i16* %3
%8 = zext i16 %7 to i32
%9 = sdiv i32 %6, %8
%10 = trunc i32 %9 to i16
store i16 %10, i16* %4
store i16 0, i16* %4
store i16 15, i16* %2
store i16 3, i16* %3
%11 = load i16, i16* %2
%12 = zext i16 %11 to i32
%13 = load i16, i16* %3
%14 = zext i16 %13 to i32
%15 = sdiv i32 %12, %14
%16 = trunc i32 %15 to i16
store i16 %16, i16* %4
store i16 0, i16* %4
store i16 -21846, i16* %2
store i16 21845, i16* %3
%17 = load i16, i16* %2
%18 = zext i16 %17 to i32
%19 = load i16, i16* %3
%20 = zext i16 %19 to i32
%21 = sdiv i32 %18, %20
%22 = trunc i32 %21 to i16
store i16 %22, i16* %4
store i16 0, i16* %4
store i16 32767, i16* %2
store i16 -1, i16* %3
%23 = load i16, i16* %2
%24 = zext i16 %23 to i32
%25 = load i16, i16* %3
%26 = zext i16 %25 to i32
%27 = sdiv i32 %24, %26
%28 = trunc i32 %27 to i16
store i16 %28, i16* %4
store i16 0, i16* %4
store i16 0, i16* %2
store i16 -32768, i16* %3
%29 = load i16, i16* %2
%30 = zext i16 %29 to i32
%31 = load i16, i16* %3
%32 = zext i16 %31 to i32
%33 = sdiv i32 %30, %32
%34 = trunc i32 %33 to i16
store i16 %34, i16* %4
store i16 0, i16* %4
store i16 48, i16* %2
store i16 5, i16* %3
%35 = load i16, i16* %2
%36 = zext i16 %35 to i32
%37 = load i16, i16* %3
%38 = zext i16 %37 to i32
%39 = sdiv i32 %36, %38
%40 = trunc i32 %39 to i16
store i16 %40, i16* %4
store i16 0, i16* %4
store i16 -1, i16* %2
store i16 -1, i16* %3
%41 = load i16, i16* %2
%42 = zext i16 %41 to i32
%43 = load i16, i16* %3
%44 = zext i16 %43 to i32
%45 = sdiv i32 %42, %44
%46 = trunc i32 %45 to i16
store i16 %46, i16* %4
store i16 0, i16* %4
store i16 -2, i16* %2
store i16 16, i16* %3
%47 = load i16, i16* %2
%48 = zext i16 %47 to i32
%49 = load i16, i16* %3
%50 = zext i16 %49 to i32
%51 = sdiv i32 %48, %50
%52 = trunc i32 %51 to i16
store i16 %52, i16* %4
store i16 0, i16* %4
store i16 32, i16* %2
store i16 -2, i16* %3
%53 = load i16, i16* %2
%54 = zext i16 %53 to i32
%55 = load i16, i16* %3
%56 = zext i16 %55 to i32
%57 = sdiv i32 %54, %56
%58 = trunc i32 %57 to i16
store i16 %58, i16* %4
store i16 0, i16* %4
store i16 0, i16* %2
store i16 -1, i16* %3
%59 = load i16, i16* %2
%60 = zext i16 %59 to i32
%61 = load i16, i16* %3
%62 = zext i16 %61 to i32
%63 = sdiv i32 %60, %62
%64 = trunc i32 %63 to i16
store i16 %64, i16* %4
store i16 0, i16* %4
store i16 120, i16* %2
%65 = load i16, i16* %2
%66 = zext i16 %65 to i32
%67 = sdiv i32 %66, 5
%68 = trunc i32 %67 to i16
store i16 %68, i16* %4
%69 = load i16, i16* %4
%70 = zext i16 %69 to i32
%71 = sdiv i32 %70, 4
%72 = trunc i32 %71 to i16
store i16 %72, i16* %4
%73 = load i16, i16* %4
%74 = zext i16 %73 to i32
%75 = sdiv i32 %74, 3
%76 = trunc i32 %75 to i16
store i16 %76, i16* %4
%77 = load i16, i16* %4
%78 = zext i16 %77 to i32
%79 = sdiv i32 %78, 2
%80 = trunc i32 %79 to i16
store i16 %80, i16* %4
store i16 0, i16* %4
store i16 16, i16* %2
%81 = load i16, i16* %2
%82 = zext i16 %81 to i32
%83 = sdiv i32 %82, 65535
%84 = trunc i32 %83 to i16
store i16 %84, i16* %4
store i16 0, i16* %4
ret i32 0
}

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