#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 */

/* Variables and functions */
int /*<<< orphan*/ ImaMashChannel(unsigned int, unsigned int, short const *,
                                  int, int *, unsigned char *, int);
void lsx_ima_block_mash_i(unsigned chans, const short *ip, int n, int *st,
                          unsigned char *obuff, int opt) {
  unsigned ch;
  for (ch = 0; ch < chans; ch++)
    ImaMashChannel(ch, chans, ip, n, st + ch, obuff, opt);
}


x86 assembly (clang, -O0):
<lsx_ima_block_mash_i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1179 <lsx_ima_block_mash_i+0x69>
mov    -0x30(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x30(%rbp),%eax
shl    $0x2,%rax
add    %rax,%r8
mov    -0x28(%rbp),%r9
mov    -0x2c(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <ImaMashChannel@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1135 <lsx_ima_block_mash_i+0x25>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsx_ima_block_mash_i>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
test   %edi,%edi
je     117d <lsx_ima_block_mash_i+0x6d>
mov    %r8,%r12
mov    %rcx,%rbp
mov    %edx,%r13d
mov    %rsi,%rbx
mov    %edi,%esi
mov    %rsi,0x10(%rsp)
xor    %r14d,%r14d
mov    %r9d,0xc(%rsp)
mov    0x10(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r9d,(%rsp)
mov    %r14d,%edi
mov    %r15d,%esi
mov    %rbx,%rdx
mov    %r13d,%ecx
mov    %rbp,%r8
mov    %r12,%r9
call   1030 <ImaMashChannel@plt>
mov    0xc(%rsp),%r9d
add    $0x1,%r14
add    $0x4,%rbp
cmp    %r14,%r15
jne    1150 <lsx_ima_block_mash_i+0x40>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @lsx_ima_block_mash_i(i32 %0, i16* %1, i32 %2, i32* %3, i8* %4, i32 %5) {
%7 = icmp eq i32 %0, 0
br i1 %7, label %17, label %8
8: ; preds = %6
%9 = zext i32 %0 to i64
br label %10
10: ; preds = %8, %10
%11 = phi i64 [ 0, %8 ], [ %15, %10 ]
%12 = getelementptr inbounds i32, i32* %3, i64 %11
%13 = trunc i64 %11 to i32
%14 = tail call i32 @ImaMashChannel(i32 %13, i32 %0, i16* %1, i32 %2, i32* %12, i8* %4, i32 %5)
%15 = add nuw nsw i64 %11, 1
%16 = icmp eq i64 %15, %9
br i1 %16, label %17, label %10
17: ; preds = %10, %6
ret void
}