#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__ u_int32_t;

/* Variables and functions */
int /*<<< orphan*/ bitvector_shl_to(scalar_t__ *, scalar_t__ *, scalar_t__,
                                    scalar_t__, int);
int /*<<< orphan*/ bitvector_shr_to(scalar_t__ *, scalar_t__ *, scalar_t__,
                                    scalar_t__);
void adjust_offset_to(u_int32_t *dest, u_int32_t *src, u_int32_t nw,
                      u_int32_t soffs, u_int32_t newoffs) {
  if (newoffs > soffs)
    bitvector_shl_to(dest, src, nw, newoffs - soffs, 1);
  else
    bitvector_shr_to(dest, src, nw, soffs - newoffs);
}


x86 assembly (clang, -O0):
<adjust_offset_to>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jle    116e <adjust_offset_to+0x4e>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%rcx
sub    -0x20(%rbp),%rcx
mov    $0x1,%r8d
call   1030 <bitvector_shl_to@plt>
jmp    1187 <adjust_offset_to+0x67>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
sub    -0x28(%rbp),%rcx
call   1040 <bitvector_shr_to@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjust_offset_to>:
mov    %r8,%rax
sub    %rcx,%rax
jle    1136 <adjust_offset_to+0x16>
mov    %rax,%rcx
mov    $0x1,%r8d
jmp    1030 <bitvector_shl_to@plt>
sub    %r8,%rcx
jmp    1040 <bitvector_shr_to@plt>

LLVM IR (-O0):
define void @adjust_offset_to(i64* %0, i64* %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i64*
%7 = alloca i64*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i64* %0, i64** %6
store i64* %1, i64** %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load i64, i64* %10
%12 = load i64, i64* %9
%13 = icmp sgt i64 %11, %12
br i1 %13, label %14, label %22
14: ; preds = %5
%15 = load i64*, i64** %6
%16 = load i64*, i64** %7
%17 = load i64, i64* %8
%18 = load i64, i64* %10
%19 = load i64, i64* %9
%20 = sub nsw i64 %18, %19
%21 = call i32 @bitvector_shl_to(i64* %15, i64* %16, i64 %17, i64 %20, i32 1)
br label %30
22: ; preds = %5
%23 = load i64*, i64** %6
%24 = load i64*, i64** %7
%25 = load i64, i64* %8
%26 = load i64, i64* %9
%27 = load i64, i64* %10
%28 = sub nsw i64 %26, %27
%29 = call i32 @bitvector_shr_to(i64* %23, i64* %24, i64 %25, i64 %28)
br label %30
30: ; preds = %22, %14
ret void
}

LLVM IR (-O2):
define void @adjust_offset_to(i64* %0, i64* %1, i64 %2, i64 %3, i64 %4) {
%6 = icmp sgt i64 %4, %3
br i1 %6, label %7, label %10
7: ; preds = %5
%8 = sub nsw i64 %4, %3
%9 = tail call i32 @bitvector_shl_to(i64* %0, i64* %1, i64 %2, i64 %8, i32 1)
br label %13
10: ; preds = %5
%11 = sub nsw i64 %3, %4
%12 = tail call i32 @bitvector_shr_to(i64* %0, i64* %1, i64 %2, i64 %11)
br label %13
13: ; preds = %10, %7
ret void
}