#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 */
int log_2(int);
int get_move_delay_from_stepsize(int move_stepsize) {
  move_stepsize =
      (((((1)) > (move_stepsize) ? ((1)) : (move_stepsize))) < ((32))
           ? ((((1)) > (move_stepsize) ? ((1)) : (move_stepsize)))
           : ((32)));
  move_stepsize = (1 << log_2(move_stepsize));
  return 32 / move_stepsize;
}


x86 assembly (clang, -O0):
<get_move_delay_from_stepsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%eax
cmp    -0x4(%rbp),%eax
jle    1136 <get_move_delay_from_stepsize+0x26>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113c <get_move_delay_from_stepsize+0x2c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    $0x20,%eax
jge    1174 <get_move_delay_from_stepsize+0x64>
mov    $0x1,%eax
cmp    -0x4(%rbp),%eax
jle    1163 <get_move_delay_from_stepsize+0x53>
mov    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1169 <get_move_delay_from_stepsize+0x59>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1181 <get_move_delay_from_stepsize+0x71>
mov    $0x20,%eax
mov    %eax,-0x10(%rbp)
jmp    1181 <get_move_delay_from_stepsize+0x71>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <log_2@plt>
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    $0x20,%eax
cltd
idivl  -0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_move_delay_from_stepsize>:
push   %rbx
test   %edi,%edi
mov    $0x1,%eax
cmovle %eax,%edi
cmp    $0x20,%edi
mov    $0x20,%ebx
cmovae %ebx,%edi
call   1030 <log_2@plt>
mov    %eax,%ecx
shr    %cl,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_move_delay_from_stepsize(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 1, %3
br i1 %4, label %5, label %6
5: ; preds = %1
br label %8
6: ; preds = %1
%7 = load i32, i32* %2
br label %8
8: ; preds = %6, %5
%9 = phi i32 [ 1, %5 ], [ %7, %6 ]
%10 = icmp slt i32 %9, 32
br i1 %10, label %11, label %19
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sgt i32 1, %12
br i1 %13, label %14, label %15
14: ; preds = %11
br label %17
15: ; preds = %11
%16 = load i32, i32* %2
br label %17
17: ; preds = %15, %14
%18 = phi i32 [ 1, %14 ], [ %16, %15 ]
br label %20
19: ; preds = %8
br label %20
20: ; preds = %19, %17
%21 = phi i32 [ %18, %17 ], [ 32, %19 ]
store i32 %21, i32* %2
%22 = load i32, i32* %2
%23 = call i32 @log_2(i32 %22)
%24 = shl i32 1, %23
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = sdiv i32 32, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @get_move_delay_from_stepsize(i32 %0) {
%2 = icmp sgt i32 %0, 1
%3 = select i1 %2, i32 %0, i32 1
%4 = icmp ult i32 %3, 32
%5 = select i1 %4, i32 %3, i32 32
%6 = tail call i32 @log_2(i32 %5)
%7 = lshr i32 32, %6
ret i32 %7
}