#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 unsigned int *mp_srcptr;
typedef size_t mp_size_t;
typedef unsigned int *mp_ptr;
typedef unsigned int mp_limb_t;

/* Variables and functions */
mp_limb_t __mpn_lshift(register mp_ptr wp, register mp_srcptr up,
                       mp_size_t usize, register unsigned int cnt) {
  register mp_limb_t high_limb, low_limb;
  register unsigned sh_1, sh_2;
  register mp_size_t i;
  mp_limb_t retval;
  sh_1 = cnt;
  wp += 1;
  sh_2 = 32 - sh_1;
  i = usize - 1;
  low_limb = up[i];
  retval = low_limb >> sh_2;
  high_limb = low_limb;
  while (--i >= 0) {
    low_limb = up[i];
    wp[i] = (high_limb << sh_1) | (low_limb >> sh_2);
    high_limb = low_limb;
  }
  wp[i] = high_limb << sh_1;
  return retval;
}


x86 assembly (clang, -O0):
<__mpn_lshift>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    $0x20,%eax
sub    -0x28(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x2c(%rbp),%ecx
shr    %cl,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x38(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
jb     11a7 <__mpn_lshift+0xa7>
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%edx
mov    -0x28(%rbp),%ecx
shl    %cl,%edx
mov    -0x24(%rbp),%eax
mov    -0x2c(%rbp),%ecx
shr    %cl,%eax
or     %eax,%edx
mov    -0x8(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x24(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    115b <__mpn_lshift+0x5b>
mov    -0x20(%rbp),%edx
mov    -0x28(%rbp),%ecx
shl    %cl,%edx
mov    -0x8(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x3c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__mpn_lshift>:
mov    %ecx,%r8d
mov    $0x20,%r9d
sub    %ecx,%r9d
mov    -0x4(%rsi,%rdx,4),%r11d
shl    $0x2,%rdx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r8d,%ecx
shl    %cl,%r11d
mov    -0x8(%rsi,%rdx,1),%r10d
mov    %r10d,%eax
mov    %r9d,%ecx
shr    %cl,%eax
or     %r11d,%eax
mov    %eax,-0x4(%rdi,%rdx,1)
add    $0xfffffffffffffffc,%rdx
mov    %r10d,%r11d
jmp    1120 <__mpn_lshift+0x20>

LLVM IR (-O0):
define i32 @__mpn_lshift(i32* %0, i32* %1, i64 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i64
%14 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%15 = load i32, i32* %8
store i32 %15, i32* %11
%16 = load i32*, i32** %5
%17 = getelementptr inbounds i32, i32* %16, i64 1
store i32* %17, i32** %5
%18 = load i32, i32* %11
%19 = sub i32 32, %18
store i32 %19, i32* %12
%20 = load i64, i64* %7
%21 = sub i64 %20, 1
store i64 %21, i64* %13
%22 = load i32*, i32** %6
%23 = load i64, i64* %13
%24 = getelementptr inbounds i32, i32* %22, i64 %23
%25 = load i32, i32* %24
store i32 %25, i32* %10
%26 = load i32, i32* %10
%27 = load i32, i32* %12
%28 = lshr i32 %26, %27
store i32 %28, i32* %14
%29 = load i32, i32* %10
store i32 %29, i32* %9
br label %30
30: ; preds = %34, %4
%31 = load i64, i64* %13
%32 = add i64 %31, -1
store i64 %32, i64* %13
%33 = icmp uge i64 %32, 0
br i1 %33, label %34, label %50
34: ; preds = %30
%35 = load i32*, i32** %6
%36 = load i64, i64* %13
%37 = getelementptr inbounds i32, i32* %35, i64 %36
%38 = load i32, i32* %37
store i32 %38, i32* %10
%39 = load i32, i32* %9
%40 = load i32, i32* %11
%41 = shl i32 %39, %40
%42 = load i32, i32* %10
%43 = load i32, i32* %12
%44 = lshr i32 %42, %43
%45 = or i32 %41, %44
%46 = load i32*, i32** %5
%47 = load i64, i64* %13
%48 = getelementptr inbounds i32, i32* %46, i64 %47
store i32 %45, i32* %48
%49 = load i32, i32* %10
store i32 %49, i32* %9
br label %30
50: ; preds = %30
%51 = load i32, i32* %9
%52 = load i32, i32* %11
%53 = shl i32 %51, %52
%54 = load i32*, i32** %5
%55 = load i64, i64* %13
%56 = getelementptr inbounds i32, i32* %54, i64 %55
store i32 %53, i32* %56
%57 = load i32, i32* %14
ret i32 %57
}

LLVM IR (-O2):
define i32 @__mpn_lshift(i32* nocapture writeonly %0, i32* nocapture %1, i64 %2, i32 %3) {
%5 = sub i32 32, %3
%6 = add i64 %2, -1
%7 = getelementptr inbounds i32, i32* %1, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %9, %4
%10 = phi i32 [ %8, %4 ], [ %14, %9 ]
%11 = phi i64 [ %6, %4 ], [ %12, %9 ]
%12 = add i64 %11, -1
%13 = getelementptr inbounds i32, i32* %1, i64 %12
%14 = load i32, i32* %13
%15 = shl i32 %10, %3
%16 = lshr i32 %14, %5
%17 = or i32 %16, %15
%18 = getelementptr inbounds i32, i32* %0, i64 %11
store i32 %17, i32* %18
br label %9
}