#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 */
int __IUSAT(int, int);
__attribute__((always_)) uint32_t __UQADD8(uint32_t x, uint32_t y) {
  int32_t r, s, t, u;
  r = __IUSAT((((x << 24) >> 24) + ((y << 24) >> 24)), 8) & 0x000000FF;
  s = __IUSAT((((x << 16) >> 24) + ((y << 16) >> 24)), 8) & 0x000000FF;
  t = __IUSAT((((x << 8) >> 24) + ((y << 8) >> 24)), 8) & 0x000000FF;
  u = __IUSAT((((x) >> 24) + ((y) >> 24)), 8) & 0x000000FF;
  return ((u << 24) | (t << 16) | (s << 8) | (r));
}


x86 assembly (clang, -O0):
<__UQADD8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x18,%edi
sar    $0x18,%edi
mov    -0x8(%rbp),%eax
shl    $0x18,%eax
sar    $0x18,%eax
add    %eax,%edi
mov    $0x8,%esi
call   1030 <__IUSAT@plt>
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x10,%edi
sar    $0x18,%edi
mov    -0x8(%rbp),%eax
shl    $0x10,%eax
sar    $0x18,%eax
add    %eax,%edi
mov    $0x8,%esi
call   1030 <__IUSAT@plt>
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x8,%edi
sar    $0x18,%edi
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
sar    $0x18,%eax
add    %eax,%edi
mov    $0x8,%esi
call   1030 <__IUSAT@plt>
and    $0xff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
sar    $0x18,%edi
mov    -0x8(%rbp),%eax
sar    $0x18,%eax
add    %eax,%edi
mov    $0x8,%esi
call   1030 <__IUSAT@plt>
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
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__UQADD8>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
movsbl %bpl,%eax
movsbl %bl,%edi
add    %eax,%edi
mov    $0x8,%esi
call   1030 <__IUSAT@plt>
movzbl %al,%r12d
mov    %ebp,%eax
shr    $0x8,%eax
movsbl %al,%eax
mov    %ebx,%ecx
shr    $0x8,%ecx
movsbl %cl,%edi
add    %eax,%edi
mov    $0x8,%esi
call   1030 <__IUSAT@plt>
mov    %eax,%r14d
mov    %ebp,%eax
shr    $0x10,%eax
movsbl %al,%eax
mov    %ebx,%ecx
shr    $0x10,%ecx
movsbl %cl,%edi
add    %eax,%edi
mov    $0x8,%esi
call   1030 <__IUSAT@plt>
mov    %eax,%r15d
sar    $0x18,%ebp
sar    $0x18,%ebx
add    %ebp,%ebx
mov    %ebx,%edi
mov    $0x8,%esi
call   1030 <__IUSAT@plt>
shl    $0x18,%eax
movzbl %r15b,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
shl    $0x8,%r14d
movzwl %r14w,%ecx
or     %ecx,%eax
or     %r12d,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @__UQADD8(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 = call i32 @__IUSAT(i32 %15, i32 8)
%17 = and i32 %16, 255
store i32 %17, i32* %5
%18 = load i32, i32* %3
%19 = shl i32 %18, 16
%20 = ashr i32 %19, 24
%21 = load i32, i32* %4
%22 = shl i32 %21, 16
%23 = ashr i32 %22, 24
%24 = add nsw i32 %20, %23
%25 = call i32 @__IUSAT(i32 %24, i32 8)
%26 = and i32 %25, 255
store i32 %26, i32* %6
%27 = load i32, i32* %3
%28 = shl i32 %27, 8
%29 = ashr i32 %28, 24
%30 = load i32, i32* %4
%31 = shl i32 %30, 8
%32 = ashr i32 %31, 24
%33 = add nsw i32 %29, %32
%34 = call i32 @__IUSAT(i32 %33, i32 8)
%35 = and i32 %34, 255
store i32 %35, i32* %7
%36 = load i32, i32* %3
%37 = ashr i32 %36, 24
%38 = load i32, i32* %4
%39 = ashr i32 %38, 24
%40 = add nsw i32 %37, %39
%41 = call i32 @__IUSAT(i32 %40, i32 8)
%42 = and i32 %41, 255
store i32 %42, i32* %8
%43 = load i32, i32* %8
%44 = shl i32 %43, 24
%45 = load i32, i32* %7
%46 = shl i32 %45, 16
%47 = or i32 %44, %46
%48 = load i32, i32* %6
%49 = shl i32 %48, 8
%50 = or i32 %47, %49
%51 = load i32, i32* %5
%52 = or i32 %50, %51
ret i32 %52
}

LLVM IR (-O2):
define i32 @__UQADD8(i32 %0, i32 %1) {
%3 = shl i32 %0, 24
%4 = ashr exact i32 %3, 24
%5 = shl i32 %1, 24
%6 = ashr exact i32 %5, 24
%7 = add nsw i32 %6, %4
%8 = tail call i32 @__IUSAT(i32 %7, i32 8)
%9 = and i32 %8, 255
%10 = shl i32 %0, 16
%11 = ashr i32 %10, 24
%12 = shl i32 %1, 16
%13 = ashr i32 %12, 24
%14 = add nsw i32 %13, %11
%15 = tail call i32 @__IUSAT(i32 %14, i32 8)
%16 = shl i32 %0, 8
%17 = ashr i32 %16, 24
%18 = shl i32 %1, 8
%19 = ashr i32 %18, 24
%20 = add nsw i32 %19, %17
%21 = tail call i32 @__IUSAT(i32 %20, i32 8)
%22 = ashr i32 %0, 24
%23 = ashr i32 %1, 24
%24 = add nsw i32 %23, %22
%25 = tail call i32 @__IUSAT(i32 %24, i32 8)
%26 = shl i32 %25, 24
%27 = shl i32 %21, 16
%28 = and i32 %27, 16711680
%29 = or i32 %26, %28
%30 = shl i32 %15, 8
%31 = and i32 %30, 65280
%32 = or i32 %29, %31
%33 = or i32 %32, %9
ret i32 %33
}