#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 rotate_right(int, int);
int test_rotate_right_positive() {
  int num = 0x0000FFFF;
  return 0x0000FFFF == rotate_right(num, 0) &&
         0xF0000FFF == rotate_right(num, 4) &&
         0xFF0000FF == rotate_right(num, 8) &&
         0xFFF0000F == rotate_right(num, 12) &&
         0xFFFF0000 == rotate_right(num, 16) &&
         0x0000FFFF == rotate_right(num, 32) &&
         0xF0000FFF == rotate_right(num, 36) &&
         0xFF0000FF == rotate_right(num, 40) &&
         0xFFF0000F == rotate_right(num, 44) &&
         0xFFFF0000 == rotate_right(num, 48);
}


x86 assembly (clang, -O0):
<test_rotate_right_positive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffff,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <rotate_right@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0xffff,%ecx
cmp    %edx,%ecx
mov    %al,-0x5(%rbp)
jne    1261 <test_rotate_right_positive+0x151>
mov    -0x4(%rbp),%edi
mov    $0x4,%esi
call   1030 <rotate_right@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0xf0000fff,%ecx
cmp    %edx,%ecx
mov    %al,-0x5(%rbp)
jne    1261 <test_rotate_right_positive+0x151>
mov    -0x4(%rbp),%edi
mov    $0x8,%esi
call   1030 <rotate_right@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0xff0000ff,%ecx
cmp    %edx,%ecx
mov    %al,-0x5(%rbp)
jne    1261 <test_rotate_right_positive+0x151>
mov    -0x4(%rbp),%edi
mov    $0xc,%esi
call   1030 <rotate_right@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0xfff0000f,%ecx
cmp    %edx,%ecx
mov    %al,-0x5(%rbp)
jne    1261 <test_rotate_right_positive+0x151>
mov    -0x4(%rbp),%edi
mov    $0x10,%esi
call   1030 <rotate_right@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0xffff0000,%ecx
cmp    %edx,%ecx
mov    %al,-0x5(%rbp)
jne    1261 <test_rotate_right_positive+0x151>
mov    -0x4(%rbp),%edi
mov    $0x20,%esi
call   1030 <rotate_right@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0xffff,%ecx
cmp    %edx,%ecx
mov    %al,-0x5(%rbp)
jne    1261 <test_rotate_right_positive+0x151>
mov    -0x4(%rbp),%edi
mov    $0x24,%esi
call   1030 <rotate_right@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0xf0000fff,%ecx
cmp    %edx,%ecx
mov    %al,-0x5(%rbp)
jne    1261 <test_rotate_right_positive+0x151>
mov    -0x4(%rbp),%edi
mov    $0x28,%esi
call   1030 <rotate_right@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0xff0000ff,%ecx
cmp    %edx,%ecx
mov    %al,-0x5(%rbp)
jne    1261 <test_rotate_right_positive+0x151>
mov    -0x4(%rbp),%edi
mov    $0x2c,%esi
call   1030 <rotate_right@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0xfff0000f,%ecx
cmp    %edx,%ecx
mov    %al,-0x5(%rbp)
jne    1261 <test_rotate_right_positive+0x151>
mov    -0x4(%rbp),%edi
mov    $0x30,%esi
call   1030 <rotate_right@plt>
mov    %eax,%ecx
mov    $0xffff0000,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_rotate_right_positive>:
push   %rbx
xor    %ebx,%ebx
mov    $0xffff,%edi
xor    %esi,%esi
call   1030 <rotate_right@plt>
cmp    $0xffff,%eax
jne    11ff <test_rotate_right_positive+0xef>
mov    $0xffff,%edi
mov    $0x4,%esi
call   1030 <rotate_right@plt>
cmp    $0xf0000fff,%eax
jne    11ff <test_rotate_right_positive+0xef>
mov    $0xffff,%edi
mov    $0x8,%esi
call   1030 <rotate_right@plt>
cmp    $0xff0000ff,%eax
jne    11ff <test_rotate_right_positive+0xef>
mov    $0xffff,%edi
mov    $0xc,%esi
call   1030 <rotate_right@plt>
cmp    $0xfff0000f,%eax
jne    11ff <test_rotate_right_positive+0xef>
mov    $0xffff,%edi
mov    $0x10,%esi
call   1030 <rotate_right@plt>
cmp    $0xffff0000,%eax
jne    11ff <test_rotate_right_positive+0xef>
mov    $0xffff,%edi
mov    $0x20,%esi
call   1030 <rotate_right@plt>
cmp    $0xffff,%eax
jne    11ff <test_rotate_right_positive+0xef>
mov    $0xffff,%edi
mov    $0x24,%esi
call   1030 <rotate_right@plt>
cmp    $0xf0000fff,%eax
jne    11ff <test_rotate_right_positive+0xef>
mov    $0xffff,%edi
mov    $0x28,%esi
call   1030 <rotate_right@plt>
cmp    $0xff0000ff,%eax
jne    11ff <test_rotate_right_positive+0xef>
mov    $0xffff,%edi
mov    $0x2c,%esi
call   1030 <rotate_right@plt>
cmp    $0xfff0000f,%eax
jne    11ff <test_rotate_right_positive+0xef>
mov    $0xffff,%edi
mov    $0x30,%esi
call   1030 <rotate_right@plt>
xor    %ebx,%ebx
cmp    $0xffff0000,%eax
sete   %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test_rotate_right_positive() {
%1 = alloca i32
store i32 65535, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @rotate_right(i32 %2, i32 0)
%4 = icmp eq i32 65535, %3
br i1 %4, label %5, label %41
5: ; preds = %0
%6 = load i32, i32* %1
%7 = call i32 @rotate_right(i32 %6, i32 4)
%8 = icmp eq i32 -268431361, %7
br i1 %8, label %9, label %41
9: ; preds = %5
%10 = load i32, i32* %1
%11 = call i32 @rotate_right(i32 %10, i32 8)
%12 = icmp eq i32 -16776961, %11
br i1 %12, label %13, label %41
13: ; preds = %9
%14 = load i32, i32* %1
%15 = call i32 @rotate_right(i32 %14, i32 12)
%16 = icmp eq i32 -1048561, %15
br i1 %16, label %17, label %41
17: ; preds = %13
%18 = load i32, i32* %1
%19 = call i32 @rotate_right(i32 %18, i32 16)
%20 = icmp eq i32 -65536, %19
br i1 %20, label %21, label %41
21: ; preds = %17
%22 = load i32, i32* %1
%23 = call i32 @rotate_right(i32 %22, i32 32)
%24 = icmp eq i32 65535, %23
br i1 %24, label %25, label %41
25: ; preds = %21
%26 = load i32, i32* %1
%27 = call i32 @rotate_right(i32 %26, i32 36)
%28 = icmp eq i32 -268431361, %27
br i1 %28, label %29, label %41
29: ; preds = %25
%30 = load i32, i32* %1
%31 = call i32 @rotate_right(i32 %30, i32 40)
%32 = icmp eq i32 -16776961, %31
br i1 %32, label %33, label %41
33: ; preds = %29
%34 = load i32, i32* %1
%35 = call i32 @rotate_right(i32 %34, i32 44)
%36 = icmp eq i32 -1048561, %35
br i1 %36, label %37, label %41
37: ; preds = %33
%38 = load i32, i32* %1
%39 = call i32 @rotate_right(i32 %38, i32 48)
%40 = icmp eq i32 -65536, %39
br label %41
41: ; preds = %37, %33, %29, %25, %21, %17, %13, %9, %5, %0
%42 = phi i1 [ false, %33 ], [ false, %29 ], [ false, %25 ], [ false, %21 ], [ false, %17 ], [ false, %13 ], [ false, %9 ], [ false, %5 ], [ false, %0 ], [ %40, %37 ]
%43 = zext i1 %42 to i32
ret i32 %43
}

LLVM IR (-O2):
define i32 @test_rotate_right_positive() {
%1 = tail call i32 @rotate_right(i32 65535, i32 0)
%2 = icmp eq i32 %1, 65535
br i1 %2, label %3, label %31
3: ; preds = %0
%4 = tail call i32 @rotate_right(i32 65535, i32 4)
%5 = icmp eq i32 %4, -268431361
br i1 %5, label %6, label %31
6: ; preds = %3
%7 = tail call i32 @rotate_right(i32 65535, i32 8)
%8 = icmp eq i32 %7, -16776961
br i1 %8, label %9, label %31
9: ; preds = %6
%10 = tail call i32 @rotate_right(i32 65535, i32 12)
%11 = icmp eq i32 %10, -1048561
br i1 %11, label %12, label %31
12: ; preds = %9
%13 = tail call i32 @rotate_right(i32 65535, i32 16)
%14 = icmp eq i32 %13, -65536
br i1 %14, label %15, label %31
15: ; preds = %12
%16 = tail call i32 @rotate_right(i32 65535, i32 32)
%17 = icmp eq i32 %16, 65535
br i1 %17, label %18, label %31
18: ; preds = %15
%19 = tail call i32 @rotate_right(i32 65535, i32 36)
%20 = icmp eq i32 %19, -268431361
br i1 %20, label %21, label %31
21: ; preds = %18
%22 = tail call i32 @rotate_right(i32 65535, i32 40)
%23 = icmp eq i32 %22, -16776961
br i1 %23, label %24, label %31
24: ; preds = %21
%25 = tail call i32 @rotate_right(i32 65535, i32 44)
%26 = icmp eq i32 %25, -1048561
br i1 %26, label %27, label %31
27: ; preds = %24
%28 = tail call i32 @rotate_right(i32 65535, i32 48)
%29 = icmp eq i32 %28, -65536
%30 = zext i1 %29 to i32
br label %31
31: ; preds = %27, %24, %21, %18, %15, %12, %9, %6, %3, %0
%32 = phi i32 [ 0, %24 ], [ 0, %21 ], [ 0, %18 ], [ 0, %15 ], [ 0, %12 ], [ 0, %9 ], [ 0, %6 ], [ 0, %3 ], [ 0, %0 ], [ %30, %27 ]
ret i32 %32
}