#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 scalar_t__ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ uintp_rotl(scalar_t__ *, int, scalar_t__ *);
void test_rotl() {
  uint64_t a1 = 0x8000000000000000;
  uint64_t b1;
  uint64_t c1 = 0x01;
  uintp_rotl(&a1, 1, &b1);
  assert(b1 == c1);
  uint64_t a2 = 0xb800000000000000;
  uint64_t b2;
  uint64_t c2 = 0x17;
  uintp_rotl(&a2, 5, &b2);
  assert(b2 == c2);
}


x86 assembly (clang, -O0):
<test_rotl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movabs $0x8000000000000000,%rax
mov    %rax,-0x8(%rbp)
movq   $0x1,-0x18(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x1,%esi
lea    -0x10(%rbp),%rdx
call   1030 <uintp_rotl@plt>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
movabs $0xb800000000000000,%rax
mov    %rax,-0x20(%rbp)
movq   $0x17,-0x30(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
lea    -0x28(%rbp),%rdx
call   1030 <uintp_rotl@plt>
mov    -0x28(%rbp),%rax
cmp    -0x30(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_rotl>:
sub    $0x28,%rsp
movabs $0x8000000000000000,%rax
mov    %rax,0x20(%rsp)
lea    0x20(%rsp),%rdi
lea    0x18(%rsp),%rdx
mov    $0x1,%esi
call   1030 <uintp_rotl@plt>
xor    %edi,%edi
cmpq   $0x1,0x18(%rsp)
sete   %dil
call   1040 <assert@plt>
movabs $0xb800000000000000,%rax
mov    %rax,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rdx
mov    $0x5,%esi
call   1030 <uintp_rotl@plt>
xor    %edi,%edi
cmpq   $0x17,0x8(%rsp)
sete   %dil
call   1040 <assert@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @test_rotl() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 -9223372036854775808, i64* %1
store i64 1, i64* %3
%7 = call i32 @uintp_rotl(i64* %1, i32 1, i64* %2)
%8 = load i64, i64* %2
%9 = load i64, i64* %3
%10 = icmp eq i64 %8, %9
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
store i64 -5188146770730811392, i64* %4
store i64 23, i64* %6
%13 = call i32 @uintp_rotl(i64* %4, i32 5, i64* %5)
%14 = load i64, i64* %5
%15 = load i64, i64* %6
%16 = icmp eq i64 %14, %15
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
ret void
}

LLVM IR (-O2):
define void @test_rotl() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = bitcast i64* %1 to i8*
store i64 -9223372036854775808, i64* %1
%6 = bitcast i64* %2 to i8*
%7 = call i32 @uintp_rotl(i64* %1, i32 1, i64* %2)
%8 = load i64, i64* %2
%9 = icmp eq i64 %8, 1
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = bitcast i64* %3 to i8*
store i64 -5188146770730811392, i64* %3
%13 = bitcast i64* %4 to i8*
%14 = call i32 @uintp_rotl(i64* %3, i32 5, i64* %4)
%15 = load i64, i64* %4
%16 = icmp eq i64 %15, 23
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
ret void
}