#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 int uint32_t;

/* Variables and functions */
void copy_fwd_until_dst_simd_aligned(uint32_t *d, const uint32_t *s,
                                     int srcoffset4, size_t dstal, int sl,
                                     int sr) {
  if (srcoffset4 == 0) {
    if (dstal == 8)
      *d++ = *s++;
  } else {
    if (dstal == 8) {
      *d = ((*(s)) >> sl) | ((*(s + 1)) << sr);
      d++;
      s++;
    }
  }
}


x86 assembly (clang, -O0):
<copy_fwd_until_dst_simd_aligned>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1157 <copy_fwd_until_dst_simd_aligned+0x57>
cmpq   $0x8,-0x20(%rbp)
jne    1152 <copy_fwd_until_dst_simd_aligned+0x52>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
jmp    11a4 <copy_fwd_until_dst_simd_aligned+0xa4>
cmpq   $0x8,-0x20(%rbp)
jne    119f <copy_fwd_until_dst_simd_aligned+0x9f>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x24(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    -0x28(%rbp),%ecx
shl    %cl,%eax
mov    -0x2c(%rbp),%ecx
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    11a4 <copy_fwd_until_dst_simd_aligned+0xa4>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_fwd_until_dst_simd_aligned>:
test   %edx,%edx
je     111d <copy_fwd_until_dst_simd_aligned+0x1d>
cmp    $0x8,%rcx
jne    1127 <copy_fwd_until_dst_simd_aligned+0x27>
mov    (%rsi),%edx
mov    0x4(%rsi),%eax
mov    %r8d,%ecx
sar    %cl,%edx
mov    %r9d,%ecx
shl    %cl,%eax
or     %edx,%eax
jmp    1125 <copy_fwd_until_dst_simd_aligned+0x25>
cmp    $0x8,%rcx
jne    1127 <copy_fwd_until_dst_simd_aligned+0x27>
mov    (%rsi),%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @copy_fwd_until_dst_simd_aligned(i32* %0, i32* %1, i32 %2, i64 %3, i32 %4, i32 %5) {
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i64
%11 = alloca i32
%12 = alloca i32
store i32* %0, i32** %7
store i32* %1, i32** %8
store i32 %2, i32* %9
store i64 %3, i64* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32, i32* %9
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %25
15: ; preds = %6
%16 = load i64, i64* %10
%17 = icmp eq i64 %16, 8
br i1 %17, label %18, label %24
18: ; preds = %15
%19 = load i32*, i32** %8
%20 = getelementptr inbounds i32, i32* %19, i32 1
store i32* %20, i32** %8
%21 = load i32, i32* %19
%22 = load i32*, i32** %7
%23 = getelementptr inbounds i32, i32* %22, i32 1
store i32* %23, i32** %7
store i32 %21, i32* %22
br label %24
24: ; preds = %18, %15
br label %45
25: ; preds = %6
%26 = load i64, i64* %10
%27 = icmp eq i64 %26, 8
br i1 %27, label %28, label %44
28: ; preds = %25
%29 = load i32*, i32** %8
%30 = load i32, i32* %29
%31 = load i32, i32* %11
%32 = ashr i32 %30, %31
%33 = load i32*, i32** %8
%34 = getelementptr inbounds i32, i32* %33, i64 1
%35 = load i32, i32* %34
%36 = load i32, i32* %12
%37 = shl i32 %35, %36
%38 = or i32 %32, %37
%39 = load i32*, i32** %7
store i32 %38, i32* %39
%40 = load i32*, i32** %7
%41 = getelementptr inbounds i32, i32* %40, i32 1
store i32* %41, i32** %7
%42 = load i32*, i32** %8
%43 = getelementptr inbounds i32, i32* %42, i32 1
store i32* %43, i32** %8
br label %44
44: ; preds = %28, %25
br label %45
45: ; preds = %44, %24
ret void
}

LLVM IR (-O2):
define void @copy_fwd_until_dst_simd_aligned(i32* nocapture writeonly %0, i32* nocapture %1, i32 %2, i64 %3, i32 %4, i32 %5) {
%7 = icmp eq i32 %2, 0
%8 = icmp eq i64 %3, 8
br i1 %7, label %9, label %12
9: ; preds = %6
br i1 %8, label %10, label %22
10: ; preds = %9
%11 = load i32, i32* %1
br label %20
12: ; preds = %6
br i1 %8, label %13, label %22
13: ; preds = %12
%14 = load i32, i32* %1
%15 = ashr i32 %14, %4
%16 = getelementptr inbounds i32, i32* %1, i64 1
%17 = load i32, i32* %16
%18 = shl i32 %17, %5
%19 = or i32 %18, %15
br label %20
20: ; preds = %10, %13
%21 = phi i32 [ %19, %13 ], [ %11, %10 ]
store i32 %21, i32* %0
br label %22
22: ; preds = %20, %12, %9
ret void
}