#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 */

/* Variables and functions */
size_t find_2n(size_t l) {
  if (l > 1) {
    float f = (float)l;
    unsigned int const t = 1U << ((*(unsigned int *)&f >> 23) - 0x7f);
    return 2 * (t << (t < l));
  }
  return 2;
}


x86 assembly (clang, -O0):
<find_2n>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x1,-0x10(%rbp)
jbe    1190 <find_2n+0x90>
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x20(%rbp)
test   %rax,%rax
movss  %xmm0,-0x1c(%rbp)
js     1150 <find_2n+0x50>
movss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
shr    $0x17,%ecx
sub    $0x7f,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x18(%rbp),%ecx
cmp    -0x10(%rbp),%rcx
setb   %cl
and    $0x1,%cl
movzbl %cl,%ecx
shl    %cl,%eax
shl    $0x1,%eax
mov    %eax,%eax
mov    %rax,-0x8(%rbp)
jmp    1198 <find_2n+0x98>
movq   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_2n>:
mov    $0x2,%eax
cmp    $0x2,%rdi
jb     1149 <find_2n+0x49>
test   %rdi,%rdi
js     1117 <find_2n+0x17>
cvtsi2ss %rdi,%xmm0
jmp    112e <find_2n+0x2e>
mov    %rdi,%rax
shr    %rax
mov    %edi,%ecx
and    $0x1,%ecx
or     %rax,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
movd   %xmm0,%ecx
shr    $0x17,%ecx
add    $0x81,%cl
mov    $0x1,%eax
shl    %cl,%eax
cmp    %rdi,%rax
setb   %cl
shl    %cl,%eax
add    %eax,%eax
ret

LLVM IR (-O0):
define i64 @find_2n(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca float
%5 = alloca i32
store i64 %0, i64* %3
%6 = load i64, i64* %3
%7 = icmp ugt i64 %6, 1
br i1 %7, label %8, label %25
8: ; preds = %1
%9 = load i64, i64* %3
%10 = uitofp i64 %9 to float
store float %10, float* %4
%11 = bitcast float* %4 to i32*
%12 = load i32, i32* %11
%13 = lshr i32 %12, 23
%14 = sub i32 %13, 127
%15 = shl i32 1, %14
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = load i32, i32* %5
%18 = zext i32 %17 to i64
%19 = load i64, i64* %3
%20 = icmp ult i64 %18, %19
%21 = zext i1 %20 to i32
%22 = shl i32 %16, %21
%23 = mul i32 2, %22
%24 = zext i32 %23 to i64
store i64 %24, i64* %2
br label %26
25: ; preds = %1
store i64 2, i64* %2
br label %26
26: ; preds = %25, %8
%27 = load i64, i64* %2
ret i64 %27
}

LLVM IR (-O2):
define i64 @find_2n(i64 %0) {
%2 = icmp ugt i64 %0, 1
br i1 %2, label %3, label %15
3: ; preds = %1
%4 = uitofp i64 %0 to float
%5 = bitcast float %4 to i32
%6 = lshr i32 %5, 23
%7 = add nsw i32 %6, -127
%8 = shl nuw i32 1, %7
%9 = zext i32 %8 to i64
%10 = icmp ult i64 %9, %0
%11 = zext i1 %10 to i32
%12 = shl i32 %8, %11
%13 = shl i32 %12, 1
%14 = zext i32 %13 to i64
br label %15
15: ; preds = %1, %3
%16 = phi i64 [ %14, %3 ], [ 2, %1 ]
ret i64 %16
}