#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 */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t __USUB8(uint32_t x, uint32_t y) {
  int32_t r, s, t, u;
  r = (((x << 24) >> 24) - ((y << 24) >> 24)) & 0x000000FF;
  s = (((x << 16) >> 24) - ((y << 16) >> 24)) & 0x000000FF;
  t = (((x << 8) >> 24) - ((y << 8) >> 24)) & 0x000000FF;
  u = (((x) >> 24) - ((y) >> 24)) & 0x000000FF;
  return ((u << 24) | (t << 16) | (s << 8) | (r));
}


x86 assembly (clang, -O0):
<__USUB8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
sar    $0x18,%eax
mov    -0x8(%rbp),%ecx
shl    $0x18,%ecx
sar    $0x18,%ecx
sub    %ecx,%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
sar    $0x18,%eax
mov    -0x8(%rbp),%ecx
shl    $0x10,%ecx
sar    $0x18,%ecx
sub    %ecx,%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
sar    $0x18,%eax
mov    -0x8(%rbp),%ecx
shl    $0x8,%ecx
sar    $0x18,%ecx
sub    %ecx,%eax
and    $0xff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
mov    -0x8(%rbp),%ecx
sar    $0x18,%ecx
sub    %ecx,%eax
and    $0xff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
shl    $0x18,%eax
mov    -0x14(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
or     -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__USUB8>:
mov    %edi,%eax
sub    %esi,%eax
movzbl %al,%r8d
mov    %esi,%r9d
and    $0xff00,%r9d
mov    %esi,%ecx
and    $0xff0000,%ecx
and    $0xff000000,%esi
mov    %edi,%edx
sub    %esi,%edx
and    $0xff000000,%edx
mov    %edi,%eax
sub    %ecx,%eax
and    $0xff0000,%eax
or     %r8d,%eax
or     %edx,%eax
sub    %r9d,%edi
and    $0xff00,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @__USUB8(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%9 = load i32, i32* %3
%10 = shl i32 %9, 24
%11 = ashr i32 %10, 24
%12 = load i32, i32* %4
%13 = shl i32 %12, 24
%14 = ashr i32 %13, 24
%15 = sub nsw i32 %11, %14
%16 = and i32 %15, 255
store i32 %16, i32* %5
%17 = load i32, i32* %3
%18 = shl i32 %17, 16
%19 = ashr i32 %18, 24
%20 = load i32, i32* %4
%21 = shl i32 %20, 16
%22 = ashr i32 %21, 24
%23 = sub nsw i32 %19, %22
%24 = and i32 %23, 255
store i32 %24, i32* %6
%25 = load i32, i32* %3
%26 = shl i32 %25, 8
%27 = ashr i32 %26, 24
%28 = load i32, i32* %4
%29 = shl i32 %28, 8
%30 = ashr i32 %29, 24
%31 = sub nsw i32 %27, %30
%32 = and i32 %31, 255
store i32 %32, i32* %7
%33 = load i32, i32* %3
%34 = ashr i32 %33, 24
%35 = load i32, i32* %4
%36 = ashr i32 %35, 24
%37 = sub nsw i32 %34, %36
%38 = and i32 %37, 255
store i32 %38, i32* %8
%39 = load i32, i32* %8
%40 = shl i32 %39, 24
%41 = load i32, i32* %7
%42 = shl i32 %41, 16
%43 = or i32 %40, %42
%44 = load i32, i32* %6
%45 = shl i32 %44, 8
%46 = or i32 %43, %45
%47 = load i32, i32* %5
%48 = or i32 %46, %47
ret i32 %48
}

LLVM IR (-O2):
define i32 @__USUB8(i32 %0, i32 %1) {
%3 = sub i32 %0, %1
%4 = and i32 %3, 255
%5 = and i32 %1, 65280
%6 = and i32 %1, 16711680
%7 = and i32 %1, -16777216
%8 = sub i32 %0, %7
%9 = and i32 %8, -16777216
%10 = sub i32 %0, %6
%11 = and i32 %10, 16711680
%12 = sub i32 %0, %5
%13 = and i32 %12, 65280
%14 = or i32 %11, %4
%15 = or i32 %14, %9
%16 = or i32 %15, %13
ret i32 %16
}