unsigned blend_screen32(register unsigned color1, register unsigned color2) {
  return (((((((color1 >> 16) ^ 255) * ((color2 >> 16) ^ 255) / 255) ^ 255))
           << 16) |
          (((((((color1 & 0xFF00) >> 8) ^ 255) *
              (((color2 & 0xFF00) >> 8) ^ 255) / 255) ^
             255))
           << 8) |
          (((((color1 & 0xFF) ^ 255) * ((color2 & 0xFF) ^ 255) / 255) ^ 255)));
}


x86 assembly (clang, -O0):
<blend_screen32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
xor    $0xff,%eax
mov    -0x8(%rbp),%ecx
shr    $0x10,%ecx
xor    $0xff,%ecx
imul   %ecx,%eax
mov    $0xff,%ecx
xor    %edx,%edx
div    %ecx
xor    $0xff,%eax
shl    $0x10,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
shr    $0x8,%eax
xor    $0xff,%eax
mov    -0x8(%rbp),%ecx
and    $0xff00,%ecx
shr    $0x8,%ecx
xor    $0xff,%ecx
imul   %ecx,%eax
mov    $0xff,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
xor    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
xor    $0xff,%eax
mov    -0x8(%rbp),%ecx
and    $0xff,%ecx
xor    $0xff,%ecx
imul   %ecx,%eax
mov    $0xff,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
xor    $0xff,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blend_screen32>:
mov    %esi,%r9d
not    %r9d
mov    %edi,%edx
not    %edx
mov    %edi,%eax
shr    $0x10,%eax
xor    $0xff,%eax
mov    %esi,%ecx
shr    $0x10,%ecx
xor    $0xff,%ecx
imul   %eax,%ecx
mov    $0x80808081,%r8d
imul   %r8,%rcx
shr    $0x20,%rcx
and    $0xffffff80,%ecx
shl    $0x9,%ecx
shr    $0x8,%edi
not    %edi
movzbl %dil,%eax
shr    $0x8,%esi
not    %esi
movzbl %sil,%esi
imul   %eax,%esi
imul   %r8,%rsi
shr    $0x20,%rsi
add    %esi,%esi
and    $0x1ff00,%esi
xor    $0xff00,%esi
movzbl %dl,%edx
movzbl %r9b,%eax
imul   %edx,%eax
imul   %r8,%rax
shr    $0x27,%rax
or     %ecx,%eax
xor    $0xff0000,%eax
or     %esi,%eax
xor    $0xff,%eax
ret

LLVM IR (-O0):
define i32 @blend_screen32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = lshr i32 %5, 16
%7 = xor i32 %6, 255
%8 = load i32, i32* %4
%9 = lshr i32 %8, 16
%10 = xor i32 %9, 255
%11 = mul i32 %7, %10
%12 = udiv i32 %11, 255
%13 = xor i32 %12, 255
%14 = shl i32 %13, 16
%15 = load i32, i32* %3
%16 = and i32 %15, 65280
%17 = lshr i32 %16, 8
%18 = xor i32 %17, 255
%19 = load i32, i32* %4
%20 = and i32 %19, 65280
%21 = lshr i32 %20, 8
%22 = xor i32 %21, 255
%23 = mul i32 %18, %22
%24 = udiv i32 %23, 255
%25 = xor i32 %24, 255
%26 = shl i32 %25, 8
%27 = or i32 %14, %26
%28 = load i32, i32* %3
%29 = and i32 %28, 255
%30 = xor i32 %29, 255
%31 = load i32, i32* %4
%32 = and i32 %31, 255
%33 = xor i32 %32, 255
%34 = mul i32 %30, %33
%35 = udiv i32 %34, 255
%36 = xor i32 %35, 255
%37 = or i32 %27, %36
ret i32 %37
}

LLVM IR (-O2):
define i32 @blend_screen32(i32 %0, i32 %1) {
%3 = lshr i32 %0, 16
%4 = xor i32 %3, 255
%5 = lshr i32 %1, 16
%6 = xor i32 %5, 255
%7 = mul nuw i32 %6, %4
%8 = udiv i32 %7, 255
%9 = shl i32 %8, 16
%10 = lshr i32 %0, 8
%11 = and i32 %10, 255
%12 = xor i32 %11, 255
%13 = lshr i32 %1, 8
%14 = and i32 %13, 255
%15 = xor i32 %14, 255
%16 = mul nuw nsw i32 %15, %12
%17 = udiv i32 %16, 255
%18 = shl nuw nsw i32 %17, 8
%19 = xor i32 %18, 65280
%20 = and i32 %0, 255
%21 = xor i32 %20, 255
%22 = and i32 %1, 255
%23 = xor i32 %22, 255
%24 = mul nuw nsw i32 %23, %21
%25 = udiv i32 %24, 255
%26 = or i32 %9, %25
%27 = xor i32 %26, 16711680
%28 = or i32 %27, %19
%29 = xor i32 %28, 255
ret i32 %29
}