#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 /*<<< orphan*/ assert(int);
int sra(int, int);
unsigned int srl(unsigned int, int);
int main(int argc, char *argv[]) {
  unsigned test_unsigned = 0x12345678;
  int test_int = 0x12345678;
  assert(srl(test_unsigned, 4) == test_unsigned >> 4);
  assert(sra(test_int, 4) == test_int >> 4);
  test_unsigned = 0x87654321;
  test_int = 0x87654321;
  assert(srl(test_unsigned, 4) == test_unsigned >> 4);
  assert(sra(test_int, 4) == test_int >> 4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x12345678,-0x14(%rbp)
movl   $0x12345678,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x4,%esi
call   1050 <srl@plt>
mov    -0x14(%rbp),%ecx
shr    $0x4,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x18(%rbp),%edi
mov    $0x4,%esi
call   1030 <sra@plt>
mov    -0x18(%rbp),%ecx
sar    $0x4,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
movl   $0x87654321,-0x14(%rbp)
movl   $0x87654321,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x4,%esi
call   1050 <srl@plt>
mov    -0x14(%rbp),%ecx
shr    $0x4,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x18(%rbp),%edi
mov    $0x4,%esi
call   1030 <sra@plt>
mov    -0x18(%rbp),%ecx
sar    $0x4,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x12345678,%edi
mov    $0x4,%esi
call   1050 <srl@plt>
xor    %edi,%edi
cmp    $0x1234567,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x12345678,%edi
mov    $0x4,%esi
call   1030 <sra@plt>
xor    %edi,%edi
cmp    $0x1234567,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x87654321,%edi
mov    $0x4,%esi
call   1050 <srl@plt>
xor    %edi,%edi
cmp    $0x8765432,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x87654321,%edi
mov    $0x4,%esi
call   1030 <sra@plt>
xor    %edi,%edi
cmp    $0xf8765432,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 305419896, i32* %6
store i32 305419896, i32* %7
%8 = load i32, i32* %6
%9 = call i32 @srl(i32 %8, i32 4)
%10 = load i32, i32* %6
%11 = lshr i32 %10, 4
%12 = icmp eq i32 %9, %11
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i32, i32* %7
%16 = call i32 @sra(i32 %15, i32 4)
%17 = load i32, i32* %7
%18 = ashr i32 %17, 4
%19 = icmp eq i32 %16, %18
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
store i32 -2023406815, i32* %6
store i32 -2023406815, i32* %7
%22 = load i32, i32* %6
%23 = call i32 @srl(i32 %22, i32 4)
%24 = load i32, i32* %6
%25 = lshr i32 %24, 4
%26 = icmp eq i32 %23, %25
%27 = zext i1 %26 to i32
%28 = call i32 @assert(i32 %27)
%29 = load i32, i32* %7
%30 = call i32 @sra(i32 %29, i32 4)
%31 = load i32, i32* %7
%32 = ashr i32 %31, 4
%33 = icmp eq i32 %30, %32
%34 = zext i1 %33 to i32
%35 = call i32 @assert(i32 %34)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @srl(i32 305419896, i32 4)
%4 = icmp eq i32 %3, 19088743
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @sra(i32 305419896, i32 4)
%8 = icmp eq i32 %7, 19088743
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = tail call i32 @srl(i32 -2023406815, i32 4)
%12 = icmp eq i32 %11, 141972530
%13 = zext i1 %12 to i32
%14 = tail call i32 @assert(i32 %13)
%15 = tail call i32 @sra(i32 -2023406815, i32 4)
%16 = icmp eq i32 %15, -126462926
%17 = zext i1 %16 to i32
%18 = tail call i32 @assert(i32 %17)
ret i32 0
}