#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 */
uint32_t decompose(uint32_t a, uint32_t *a0) {
  int32_t t, u;
  t = a & 0x7FFFF;
  t += (a >> 19) << 9;
  t -= (2U * (((8380417U - 1U) / 16U) / 2U)) / 2 + 1;
  t += (t >> 31) & (2U * (((8380417U - 1U) / 16U) / 2U));
  t -= (2U * (((8380417U - 1U) / 16U) / 2U)) / 2 - 1;
  a -= t;
  u = a - 1;
  u >>= 31;
  a = (a >> 19) + 1;
  a -= u & 1;
  *a0 = 8380417U + t - (a >> 4);
  a &= 0xF;
  return a;
}


x86 assembly (clang, -O0):
<decompose>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7ffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x13,%eax
shl    $0x9,%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x3ff01,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sar    $0x1f,%eax
and    $0x7fe00,%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x3feff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x13,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x18(%rbp),%ecx
and    $0x1,%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x14(%rbp),%ecx
add    $0x7fe001,%ecx
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
sub    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decompose>:
mov    %edi,%eax
and    $0x7ffff,%eax
mov    %edi,%ecx
sar    $0xa,%ecx
and    $0xfffffe00,%ecx
lea    (%rcx,%rax,1),%edx
add    %eax,%ecx
add    $0x7fe00,%ecx
cmp    $0x3ff01,%edx
cmovge %edx,%ecx
add    $0xfffc00ff,%ecx
sub    %ecx,%edi
lea    0x3feff(%rdi),%eax
add    $0x3fefe,%edi
sar    $0x1f,%edi
sar    $0x13,%eax
add    %edi,%eax
add    $0x1,%eax
mov    %eax,%edx
sar    $0x4,%edx
sub    %edx,%ecx
add    $0x7be102,%ecx
mov    %ecx,(%rsi)
and    $0xf,%eax
ret

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

LLVM IR (-O2):
define i32 @decompose(i32 %0, i32* nocapture writeonly %1) {
%3 = and i32 %0, 524287
%4 = ashr i32 %0, 10
%5 = and i32 %4, -512
%6 = add nsw i32 %5, %3
%7 = add nsw i32 %6, -261889
%8 = icmp slt i32 %6, 261889
%9 = select i1 %8, i32 523776, i32 0
%10 = add nsw i32 %7, %9
%11 = add i32 %0, 261887
%12 = sub i32 %11, %10
%13 = add nsw i32 %12, -1
%14 = ashr i32 %13, 31
%15 = ashr i32 %12, 19
%16 = add nsw i32 %15, 1
%17 = add nsw i32 %16, %14
%18 = add nsw i32 %10, 8118530
%19 = ashr i32 %17, 4
%20 = sub nsw i32 %18, %19
store i32 %20, i32* %1
%21 = and i32 %17, 15
ret i32 %21
}