#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 __UADD8(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):
<__UADD8>:
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
add    %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
add    %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
add    %ecx,%eax
and    $0xff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
mov    -0x8(%rbp),%ecx
sar    $0x18,%ecx
add    %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):
<__UADD8>:
lea    (%rsi,%rdi,1),%eax
movzbl %al,%ecx
mov    %edi,%eax
and    $0xff00,%eax
mov    %edi,%edx
and    $0xff0000,%edx
and    $0xff000000,%edi
add    %esi,%edi
and    $0xff000000,%edi
add    %esi,%edx
and    $0xff0000,%edx
or     %edi,%edx
add    %esi,%eax
and    $0xff00,%eax
or     %edx,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @__UADD8(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 = add 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 = add 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 = add 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 = add 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 @__UADD8(i32 %0, i32 %1) {
%3 = add i32 %1, %0
%4 = and i32 %3, 255
%5 = and i32 %0, 65280
%6 = and i32 %0, 16711680
%7 = and i32 %0, -16777216
%8 = add i32 %7, %1
%9 = and i32 %8, -16777216
%10 = add i32 %6, %1
%11 = and i32 %10, 16711680
%12 = or i32 %9, %11
%13 = add i32 %5, %1
%14 = and i32 %13, 65280
%15 = or i32 %12, %14
%16 = or i32 %15, %4
ret i32 %16
}