#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 ptrdiff_t;
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
void dav1d_inv_identity8_1d_c(int32_t *const c, const ptrdiff_t stride,
                              const int min, const int max) {
  assert(stride > 0);
  for (int i = 0; i < 8; i++)
    c[stride * i] *= 2;
}


x86 assembly (clang, -O0):
<dav1d_inv_identity8_1d_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x0,-0x18(%rbp)
cmpl   $0x8,-0x18(%rbp)
jge    116c <dav1d_inv_identity8_1d_c+0x5c>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
imul   -0x18(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
shl    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113d <dav1d_inv_identity8_1d_c+0x2d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dav1d_inv_identity8_1d_c>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
test   %esi,%esi
setg   %dil
call   1030 <assert@plt>
movslq %ebp,%rax
shll   (%rbx)
shll   (%rbx,%rax,4)
shll   (%rbx,%rax,8)
lea    (%rax,%rax,2),%rcx
shll   (%rbx,%rcx,4)
lea    (%rax,%rax,4),%rdx
lea    (%rax,%rax,8),%rsi
lea    (%rsi,%rsi,2),%rsi
add    %rax,%rsi
shl    $0x4,%rax
shll   (%rbx,%rax,1)
shll   (%rbx,%rdx,4)
shll   (%rbx,%rcx,8)
shll   (%rbx,%rsi,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @dav1d_inv_identity8_1d_c(i32* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %1, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = sext i32 %1 to i64
%9 = load i32, i32* %0
%10 = shl nsw i32 %9, 1
store i32 %10, i32* %0
%11 = getelementptr inbounds i32, i32* %0, i64 %8
%12 = load i32, i32* %11
%13 = shl nsw i32 %12, 1
store i32 %13, i32* %11
%14 = shl nsw i64 %8, 1
%15 = getelementptr inbounds i32, i32* %0, i64 %14
%16 = load i32, i32* %15
%17 = shl nsw i32 %16, 1
store i32 %17, i32* %15
%18 = mul nsw i64 %8, 3
%19 = getelementptr inbounds i32, i32* %0, i64 %18
%20 = load i32, i32* %19
%21 = shl nsw i32 %20, 1
store i32 %21, i32* %19
%22 = shl nsw i64 %8, 2
%23 = getelementptr inbounds i32, i32* %0, i64 %22
%24 = load i32, i32* %23
%25 = shl nsw i32 %24, 1
store i32 %25, i32* %23
%26 = mul nsw i64 %8, 5
%27 = getelementptr inbounds i32, i32* %0, i64 %26
%28 = load i32, i32* %27
%29 = shl nsw i32 %28, 1
store i32 %29, i32* %27
%30 = mul nsw i64 %8, 6
%31 = getelementptr inbounds i32, i32* %0, i64 %30
%32 = load i32, i32* %31
%33 = shl nsw i32 %32, 1
store i32 %33, i32* %31
%34 = mul nsw i64 %8, 7
%35 = getelementptr inbounds i32, i32* %0, i64 %34
%36 = load i32, i32* %35
%37 = shl nsw i32 %36, 1
store i32 %37, i32* %35
ret void
}