#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 unsigned long uint64_t;
typedef unsigned long int64_t;

/* Variables and functions */
uint64_t exp_radix(unsigned int n) {
  int64_t x = 1;
  if (n > 19)
    return 0;
  if (n >= 16) {
    x *= ((unsigned long)((
              (unsigned long)(((unsigned long)(((unsigned long)(10) * (10))) *
                               (((unsigned long)(10) * (10))))) *
              (((unsigned long)(((unsigned long)(10) * (10))) *
                (((unsigned long)(10) * (10))))))) *
          (((unsigned long)(((unsigned long)(((unsigned long)(10) * (10))) *
                             (((unsigned long)(10) * (10))))) *
            (((unsigned long)(((unsigned long)(10) * (10))) *
              (((unsigned long)(10) * (10))))))));
    n -= 16;
  }
  if (n >= 8) {
    x *= ((unsigned long)(((unsigned long)(((unsigned long)(10) * (10))) *
                           (((unsigned long)(10) * (10))))) *
          (((unsigned long)(((unsigned long)(10) * (10))) *
            (((unsigned long)(10) * (10))))));
    n -= 8;
  }
  if (n >= 4) {
    x *= ((unsigned long)(((unsigned long)(10) * (10))) *
          (((unsigned long)(10) * (10))));
    n -= 4;
  }
  if (n >= 2) {
    x *= ((unsigned long)(10) * (10));
    n -= 2;
  }
  if (n >= 1) {
    x *= 10;
    n -= 1;
  }
  return x;
}


x86 assembly (clang, -O0):
<exp_radix>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
movq   $0x1,-0x18(%rbp)
cmpl   $0x13,-0xc(%rbp)
jbe    1126 <exp_radix+0x26>
movq   $0x0,-0x8(%rbp)
jmp    11ca <exp_radix+0xca>
cmpl   $0x10,-0xc(%rbp)
jb     114c <exp_radix+0x4c>
movabs $0x2386f26fc10000,%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x10,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jb     116b <exp_radix+0x6b>
imul   $0x5f5e100,-0x18(%rbp),%rax
05
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x8,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jb     118a <exp_radix+0x8a>
imul   $0x2710,-0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x4,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jb     11a6 <exp_radix+0xa6>
imul   $0x64,-0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jb     11c2 <exp_radix+0xc2>
imul   $0xa,-0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exp_radix>:
cmp    $0x13,%edi
jbe    1108 <exp_radix+0x8>
xor    %eax,%eax
ret
lea    -0x10(%rdi),%eax
cmp    $0x10,%edi
cmovb  %edi,%eax
movabs $0x2386f26fc10000,%rcx
mov    $0x1,%edx
cmovae %rcx,%rdx
imul   $0x5f5e100,%rdx,%rcx
lea    -0x8(%rax),%esi
cmp    $0x8,%eax
cmovb  %eax,%esi
cmovb  %rdx,%rcx
imul   $0x2710,%rcx,%rax
lea    -0x4(%rsi),%edx
cmp    $0x4,%esi
cmovb  %esi,%edx
cmovb  %rcx,%rax
imul   $0x64,%rax,%rcx
lea    -0x2(%rdx),%esi
cmp    $0x2,%edx
cmovb  %edx,%esi
cmovb  %rax,%rcx
lea    (%rcx,%rcx,1),%rax
test   %esi,%esi
lea    (%rax,%rax,4),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
define i64 @exp_radix(i32 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 1, i64* %4
%5 = load i32, i32* %3
%6 = icmp ugt i32 %5, 19
br i1 %6, label %7, label %8
7: ; preds = %1
store i64 0, i64* %2
br label %50
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp uge i32 %9, 16
br i1 %10, label %11, label %16
11: ; preds = %8
%12 = load i64, i64* %4
%13 = mul i64 %12, 10000000000000000
store i64 %13, i64* %4
%14 = load i32, i32* %3
%15 = sub i32 %14, 16
store i32 %15, i32* %3
br label %16
16: ; preds = %11, %8
%17 = load i32, i32* %3
%18 = icmp uge i32 %17, 8
br i1 %18, label %19, label %24
19: ; preds = %16
%20 = load i64, i64* %4
%21 = mul i64 %20, 100000000
store i64 %21, i64* %4
%22 = load i32, i32* %3
%23 = sub i32 %22, 8
store i32 %23, i32* %3
br label %24
24: ; preds = %19, %16
%25 = load i32, i32* %3
%26 = icmp uge i32 %25, 4
br i1 %26, label %27, label %32
27: ; preds = %24
%28 = load i64, i64* %4
%29 = mul i64 %28, 10000
store i64 %29, i64* %4
%30 = load i32, i32* %3
%31 = sub i32 %30, 4
store i32 %31, i32* %3
br label %32
32: ; preds = %27, %24
%33 = load i32, i32* %3
%34 = icmp uge i32 %33, 2
br i1 %34, label %35, label %40
35: ; preds = %32
%36 = load i64, i64* %4
%37 = mul i64 %36, 100
store i64 %37, i64* %4
%38 = load i32, i32* %3
%39 = sub i32 %38, 2
store i32 %39, i32* %3
br label %40
40: ; preds = %35, %32
%41 = load i32, i32* %3
%42 = icmp uge i32 %41, 1
br i1 %42, label %43, label %48
43: ; preds = %40
%44 = load i64, i64* %4
%45 = mul i64 %44, 10
store i64 %45, i64* %4
%46 = load i32, i32* %3
%47 = sub i32 %46, 1
store i32 %47, i32* %3
br label %48
48: ; preds = %43, %40
%49 = load i64, i64* %4
store i64 %49, i64* %2
br label %50
50: ; preds = %48, %7
%51 = load i64, i64* %2
ret i64 %51
}

LLVM IR (-O2):
define i64 @exp_radix(i32 %0) {
%2 = icmp ugt i32 %0, 19
br i1 %2, label %26, label %3
3: ; preds = %1
%4 = icmp ugt i32 %0, 15
%5 = add nsw i32 %0, -16
%6 = select i1 %4, i32 %5, i32 %0
%7 = select i1 %4, i64 10000000000000000, i64 1
%8 = icmp ugt i32 %6, 7
%9 = mul i64 %7, 100000000
%10 = add nsw i32 %6, -8
%11 = select i1 %8, i32 %10, i32 %6
%12 = select i1 %8, i64 %9, i64 %7
%13 = icmp ugt i32 %11, 3
%14 = mul i64 %12, 10000
%15 = add nsw i32 %11, -4
%16 = select i1 %13, i32 %15, i32 %11
%17 = select i1 %13, i64 %14, i64 %12
%18 = icmp ugt i32 %16, 1
%19 = mul i64 %17, 100
%20 = add nsw i32 %16, -2
%21 = select i1 %18, i32 %20, i32 %16
%22 = select i1 %18, i64 %19, i64 %17
%23 = icmp eq i32 %21, 0
%24 = mul i64 %22, 10
%25 = select i1 %23, i64 %22, i64 %24
br label %26
26: ; preds = %1, %3
%27 = phi i64 [ %25, %3 ], [ 0, %1 ]
ret i64 %27
}