#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 int_fast32_t;

/* Variables and functions */
size_t SIZE_MAX;
int UINT64_C(int);
size_t k_mer_universe_size(int_fast32_t k) {
  if (k >= 32)
    return SIZE_MAX;
  size_t universe_size = UINT64_C(1) << ((k << 1) - 1);
  if (!(k & 1))
    universe_size += UINT64_C(1) << (k - 1);
  return universe_size;
}


x86 assembly (clang, -O0):
<k_mer_universe_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jl     1138 <k_mer_universe_size+0x28>
mov    0x2eac(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1186 <k_mer_universe_size+0x76>
mov    $0x1,%edi
call   1030 <UINT64_C@plt>
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
shl    %cl,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    117e <k_mer_universe_size+0x6e>
mov    $0x1,%edi
call   1030 <UINT64_C@plt>
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
shl    %cl,%eax
cltq
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<k_mer_universe_size>:
push   %r14
push   %rbx
push   %rax
cmp    $0x20,%edi
jl     1125 <k_mer_universe_size+0x15>
mov    0x2eb8(%rip),%rax
mov    (%rax),%r14
jmp    1157 <k_mer_universe_size+0x47>
mov    %edi,%ebx
mov    $0x1,%edi
call   1030 <UINT64_C@plt>
lea    (%rbx,%rbx,1),%ecx
add    $0xff,%cl
shl    %cl,%eax
movslq %eax,%r14
test   $0x1,%bl
jne    1157 <k_mer_universe_size+0x47>
mov    $0x1,%edi
call   1030 <UINT64_C@plt>
add    $0xff,%bl
mov    %ebx,%ecx
shl    %cl,%eax
cltq
add    %rax,%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SIZE_MAX = global i64 0
define i64 @k_mer_universe_size(i32 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp sge i32 %5, 32
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i64, i64* @SIZE_MAX
store i64 %8, i64* %2
br label %29
9: ; preds = %1
%10 = call i32 @UINT64_C(i32 1)
%11 = load i32, i32* %3
%12 = shl i32 %11, 1
%13 = sub nsw i32 %12, 1
%14 = shl i32 %10, %13
%15 = sext i32 %14 to i64
store i64 %15, i64* %4
%16 = load i32, i32* %3
%17 = and i32 %16, 1
%18 = icmp ne i32 %17, 0
br i1 %18, label %27, label %19
19: ; preds = %9
%20 = call i32 @UINT64_C(i32 1)
%21 = load i32, i32* %3
%22 = sub nsw i32 %21, 1
%23 = shl i32 %20, %22
%24 = sext i32 %23 to i64
%25 = load i64, i64* %4
%26 = add i64 %25, %24
store i64 %26, i64* %4
br label %27
27: ; preds = %19, %9
%28 = load i64, i64* %4
store i64 %28, i64* %2
br label %29
29: ; preds = %27, %7
%30 = load i64, i64* %2
ret i64 %30
}

LLVM IR (-O2):
@SIZE_MAX = global i64 0
define i64 @k_mer_universe_size(i32 %0) {
%2 = icmp sgt i32 %0, 31
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = load i64, i64* @SIZE_MAX
br label %19
5: ; preds = %1
%6 = tail call i32 @UINT64_C(i32 1)
%7 = shl i32 %0, 1
%8 = add nsw i32 %7, -1
%9 = shl i32 %6, %8
%10 = sext i32 %9 to i64
%11 = and i32 %0, 1
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %5
%14 = tail call i32 @UINT64_C(i32 1)
%15 = add nsw i32 %0, -1
%16 = shl i32 %14, %15
%17 = sext i32 %16 to i64
%18 = add nsw i64 %17, %10
br label %19
19: ; preds = %5, %13, %3
%20 = phi i64 [ %4, %3 ], [ %10, %5 ], [ %18, %13 ]
ret i64 %20
}