#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*/ idct_dequant_0_2x_neon(short *, short, unsigned char *, int);
int /*<<< orphan*/ idct_dequant_full_2x_neon(short *, short *, unsigned char *,
                                             int);
void vp8_dequant_idct_add_uv_block_neon(short *q, short *dq,
                                        unsigned char *dstu,
                                        unsigned char *dstv, int stride,
                                        char *eobs) {
  if (((short *)(eobs))[0]) {
    if (((short *)eobs)[0] & 0xfefe)
      idct_dequant_full_2x_neon(q, dq, dstu, stride);
    else
      idct_dequant_0_2x_neon(q, dq[0], dstu, stride);
  }
  q += 32;
  dstu += 4 * stride;
  if (((short *)(eobs))[1]) {
    if (((short *)eobs)[1] & 0xfefe)
      idct_dequant_full_2x_neon(q, dq, dstu, stride);
    else
      idct_dequant_0_2x_neon(q, dq[0], dstu, stride);
  }
  q += 32;
  if (((short *)(eobs))[2]) {
    if (((short *)eobs)[2] & 0xfefe)
      idct_dequant_full_2x_neon(q, dq, dstv, stride);
    else
      idct_dequant_0_2x_neon(q, dq[0], dstv, stride);
  }
  q += 32;
  dstv += 4 * stride;
  if (((short *)(eobs))[3]) {
    if (((short *)eobs)[3] & 0xfefe)
      idct_dequant_full_2x_neon(q, dq, dstv, stride);
    else
      idct_dequant_0_2x_neon(q, dq[0], dstv, stride);
  }
}


x86 assembly (clang, -O0):
<vp8_dequant_idct_add_uv_block_neon>:
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    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmpw   $0x0,(%rax)
je     119b <vp8_dequant_idct_add_uv_block_neon+0x7b>
mov    -0x30(%rbp),%rax
movswl (%rax),%eax
and    $0xfefe,%eax
cmp    $0x0,%eax
je     117c <vp8_dequant_idct_add_uv_block_neon+0x5c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1040 <idct_dequant_full_2x_neon@plt>
jmp    1196 <vp8_dequant_idct_add_uv_block_neon+0x76>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%ax
mov    -0x18(%rbp),%rdx
mov    -0x24(%rbp),%ecx
movswl %ax,%esi
call   1030 <idct_dequant_0_2x_neon@plt>
jmp    119b <vp8_dequant_idct_add_uv_block_neon+0x7b>
mov    -0x8(%rbp),%rax
add    $0x40,%rax
mov    %rax,-0x8(%rbp)
mov    -0x24(%rbp),%ecx
shl    $0x2,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x30(%rbp),%rax
cmpw   $0x0,0x2(%rax)
je     1218 <vp8_dequant_idct_add_uv_block_neon+0xf8>
mov    -0x30(%rbp),%rax
movswl 0x2(%rax),%eax
and    $0xfefe,%eax
cmp    $0x0,%eax
je     11f9 <vp8_dequant_idct_add_uv_block_neon+0xd9>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1040 <idct_dequant_full_2x_neon@plt>
jmp    1213 <vp8_dequant_idct_add_uv_block_neon+0xf3>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%ax
mov    -0x18(%rbp),%rdx
mov    -0x24(%rbp),%ecx
movswl %ax,%esi
call   1030 <idct_dequant_0_2x_neon@plt>
jmp    1218 <vp8_dequant_idct_add_uv_block_neon+0xf8>
mov    -0x8(%rbp),%rax
add    $0x40,%rax
mov    %rax,-0x8(%rbp)
mov    -0x30(%rbp),%rax
cmpw   $0x0,0x4(%rax)
je     1281 <vp8_dequant_idct_add_uv_block_neon+0x161>
mov    -0x30(%rbp),%rax
movswl 0x4(%rax),%eax
and    $0xfefe,%eax
cmp    $0x0,%eax
je     1262 <vp8_dequant_idct_add_uv_block_neon+0x142>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1040 <idct_dequant_full_2x_neon@plt>
jmp    127c <vp8_dequant_idct_add_uv_block_neon+0x15c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%ax
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
movswl %ax,%esi
call   1030 <idct_dequant_0_2x_neon@plt>
jmp    1281 <vp8_dequant_idct_add_uv_block_neon+0x161>
mov    -0x8(%rbp),%rax
add    $0x40,%rax
mov    %rax,-0x8(%rbp)
mov    -0x24(%rbp),%ecx
shl    $0x2,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x30(%rbp),%rax
cmpw   $0x0,0x6(%rax)
je     12fe <vp8_dequant_idct_add_uv_block_neon+0x1de>
mov    -0x30(%rbp),%rax
movswl 0x6(%rax),%eax
and    $0xfefe,%eax
cmp    $0x0,%eax
je     12df <vp8_dequant_idct_add_uv_block_neon+0x1bf>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1040 <idct_dequant_full_2x_neon@plt>
jmp    12f9 <vp8_dequant_idct_add_uv_block_neon+0x1d9>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%ax
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
movswl %ax,%esi
call   1030 <idct_dequant_0_2x_neon@plt>
jmp    12fe <vp8_dequant_idct_add_uv_block_neon+0x1de>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vp8_dequant_idct_add_uv_block_neon>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%rbx
mov    %r8d,%r12d
mov    %rcx,%r14
mov    %rdx,%rbp
mov    %rsi,%r15
mov    %rdi,%r13
movzwl (%r9),%eax
test   %ax,%ax
je     1172 <vp8_dequant_idct_add_uv_block_neon+0x52>
test   $0xfefe,%eax
je     1160 <vp8_dequant_idct_add_uv_block_neon+0x40>
mov    %r13,%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
mov    %r12d,%ecx
call   1040 <idct_dequant_full_2x_neon@plt>
jmp    1172 <vp8_dequant_idct_add_uv_block_neon+0x52>
movswl (%r15),%esi
mov    %r13,%rdi
mov    %rbp,%rdx
mov    %r12d,%ecx
call   1030 <idct_dequant_0_2x_neon@plt>
lea    0x0(,%r12,4),%eax
cltq
mov    %rax,(%rsp)
movzwl 0x2(%rbx),%eax
test   %ax,%ax
je     11b7 <vp8_dequant_idct_add_uv_block_neon+0x97>
lea    0x40(%r13),%rdi
add    (%rsp),%rbp
test   $0xfefe,%eax
je     11a8 <vp8_dequant_idct_add_uv_block_neon+0x88>
mov    %r15,%rsi
mov    %rbp,%rdx
mov    %r12d,%ecx
call   1040 <idct_dequant_full_2x_neon@plt>
jmp    11b7 <vp8_dequant_idct_add_uv_block_neon+0x97>
movswl (%r15),%esi
mov    %rbp,%rdx
mov    %r12d,%ecx
call   1030 <idct_dequant_0_2x_neon@plt>
movzwl 0x4(%rbx),%eax
test   %ax,%ax
je     11ed <vp8_dequant_idct_add_uv_block_neon+0xcd>
lea    0x80(%r13),%rdi
test   $0xfefe,%eax
je     11de <vp8_dequant_idct_add_uv_block_neon+0xbe>
mov    %r15,%rsi
mov    %r14,%rdx
mov    %r12d,%ecx
call   1040 <idct_dequant_full_2x_neon@plt>
jmp    11ed <vp8_dequant_idct_add_uv_block_neon+0xcd>
movswl (%r15),%esi
mov    %r14,%rdx
mov    %r12d,%ecx
call   1030 <idct_dequant_0_2x_neon@plt>
movzwl 0x6(%rbx),%eax
test   %ax,%ax
je     1227 <vp8_dequant_idct_add_uv_block_neon+0x107>
add    $0xc0,%r13
add    (%rsp),%r14
test   $0xfefe,%eax
je     1236 <vp8_dequant_idct_add_uv_block_neon+0x116>
mov    %r13,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %r12d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <idct_dequant_full_2x_neon@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movswl (%r15),%esi
mov    %r13,%rdi
mov    %r14,%rdx
mov    %r12d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <idct_dequant_0_2x_neon@plt>

LLVM IR (-O0):
define void @vp8_dequant_idct_add_uv_block_neon(i16* %0, i16* %1, i8* %2, i8* %3, i32 %4, i8* %5) {
%7 = alloca i16*
%8 = alloca i16*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8*
store i16* %0, i16** %7
store i16* %1, i16** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i8* %5, i8** %12
%13 = load i8*, i8** %12
%14 = bitcast i8* %13 to i16*
%15 = getelementptr inbounds i16, i16* %14, i64 0
%16 = load i16, i16* %15
%17 = icmp ne i16 %16, 0
br i1 %17, label %18, label %41
18: ; preds = %6
%19 = load i8*, i8** %12
%20 = bitcast i8* %19 to i16*
%21 = getelementptr inbounds i16, i16* %20, i64 0
%22 = load i16, i16* %21
%23 = sext i16 %22 to i32
%24 = and i32 %23, 65278
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %32
26: ; preds = %18
%27 = load i16*, i16** %7
%28 = load i16*, i16** %8
%29 = load i8*, i8** %9
%30 = load i32, i32* %11
%31 = call i32 @idct_dequant_full_2x_neon(i16* %27, i16* %28, i8* %29, i32 %30)
br label %40
32: ; preds = %18
%33 = load i16*, i16** %7
%34 = load i16*, i16** %8
%35 = getelementptr inbounds i16, i16* %34, i64 0
%36 = load i16, i16* %35
%37 = load i8*, i8** %9
%38 = load i32, i32* %11
%39 = call i32 @idct_dequant_0_2x_neon(i16* %33, i16 signext %36, i8* %37, i32 %38)
br label %40
40: ; preds = %32, %26
br label %41
41: ; preds = %40, %6
%42 = load i16*, i16** %7
%43 = getelementptr inbounds i16, i16* %42, i64 32
store i16* %43, i16** %7
%44 = load i32, i32* %11
%45 = mul nsw i32 4, %44
%46 = load i8*, i8** %9
%47 = sext i32 %45 to i64
%48 = getelementptr inbounds i8, i8* %46, i64 %47
store i8* %48, i8** %9
%49 = load i8*, i8** %12
%50 = bitcast i8* %49 to i16*
%51 = getelementptr inbounds i16, i16* %50, i64 1
%52 = load i16, i16* %51
%53 = icmp ne i16 %52, 0
br i1 %53, label %54, label %77
54: ; preds = %41
%55 = load i8*, i8** %12
%56 = bitcast i8* %55 to i16*
%57 = getelementptr inbounds i16, i16* %56, i64 1
%58 = load i16, i16* %57
%59 = sext i16 %58 to i32
%60 = and i32 %59, 65278
%61 = icmp ne i32 %60, 0
br i1 %61, label %62, label %68
62: ; preds = %54
%63 = load i16*, i16** %7
%64 = load i16*, i16** %8
%65 = load i8*, i8** %9
%66 = load i32, i32* %11
%67 = call i32 @idct_dequant_full_2x_neon(i16* %63, i16* %64, i8* %65, i32 %66)
br label %76
68: ; preds = %54
%69 = load i16*, i16** %7
%70 = load i16*, i16** %8
%71 = getelementptr inbounds i16, i16* %70, i64 0
%72 = load i16, i16* %71
%73 = load i8*, i8** %9
%74 = load i32, i32* %11
%75 = call i32 @idct_dequant_0_2x_neon(i16* %69, i16 signext %72, i8* %73, i32 %74)
br label %76
76: ; preds = %68, %62
br label %77
77: ; preds = %76, %41
%78 = load i16*, i16** %7
%79 = getelementptr inbounds i16, i16* %78, i64 32
store i16* %79, i16** %7
%80 = load i8*, i8** %12
%81 = bitcast i8* %80 to i16*
%82 = getelementptr inbounds i16, i16* %81, i64 2
%83 = load i16, i16* %82
%84 = icmp ne i16 %83, 0
br i1 %84, label %85, label %108
85: ; preds = %77
%86 = load i8*, i8** %12
%87 = bitcast i8* %86 to i16*
%88 = getelementptr inbounds i16, i16* %87, i64 2
%89 = load i16, i16* %88
%90 = sext i16 %89 to i32
%91 = and i32 %90, 65278
%92 = icmp ne i32 %91, 0
br i1 %92, label %93, label %99
93: ; preds = %85
%94 = load i16*, i16** %7
%95 = load i16*, i16** %8
%96 = load i8*, i8** %10
%97 = load i32, i32* %11
%98 = call i32 @idct_dequant_full_2x_neon(i16* %94, i16* %95, i8* %96, i32 %97)
br label %107
99: ; preds = %85
%100 = load i16*, i16** %7
%101 = load i16*, i16** %8
%102 = getelementptr inbounds i16, i16* %101, i64 0
%103 = load i16, i16* %102
%104 = load i8*, i8** %10
%105 = load i32, i32* %11
%106 = call i32 @idct_dequant_0_2x_neon(i16* %100, i16 signext %103, i8* %104, i32 %105)
br label %107
107: ; preds = %99, %93
br label %108
108: ; preds = %107, %77
%109 = load i16*, i16** %7
%110 = getelementptr inbounds i16, i16* %109, i64 32
store i16* %110, i16** %7
%111 = load i32, i32* %11
%112 = mul nsw i32 4, %111
%113 = load i8*, i8** %10
%114 = sext i32 %112 to i64
%115 = getelementptr inbounds i8, i8* %113, i64 %114
store i8* %115, i8** %10
%116 = load i8*, i8** %12
%117 = bitcast i8* %116 to i16*
%118 = getelementptr inbounds i16, i16* %117, i64 3
%119 = load i16, i16* %118
%120 = icmp ne i16 %119, 0
br i1 %120, label %121, label %144
121: ; preds = %108
%122 = load i8*, i8** %12
%123 = bitcast i8* %122 to i16*
%124 = getelementptr inbounds i16, i16* %123, i64 3
%125 = load i16, i16* %124
%126 = sext i16 %125 to i32
%127 = and i32 %126, 65278
%128 = icmp ne i32 %127, 0
br i1 %128, label %129, label %135
129: ; preds = %121
%130 = load i16*, i16** %7
%131 = load i16*, i16** %8
%132 = load i8*, i8** %10
%133 = load i32, i32* %11
%134 = call i32 @idct_dequant_full_2x_neon(i16* %130, i16* %131, i8* %132, i32 %133)
br label %143
135: ; preds = %121
%136 = load i16*, i16** %7
%137 = load i16*, i16** %8
%138 = getelementptr inbounds i16, i16* %137, i64 0
%139 = load i16, i16* %138
%140 = load i8*, i8** %10
%141 = load i32, i32* %11
%142 = call i32 @idct_dequant_0_2x_neon(i16* %136, i16 signext %139, i8* %140, i32 %141)
br label %143
143: ; preds = %135, %129
br label %144
144: ; preds = %143, %108
ret void
}

LLVM IR (-O2):
define void @vp8_dequant_idct_add_uv_block_neon(i16* %0, i16* %1, i8* %2, i8* %3, i32 %4, i8* nocapture %5) {
%7 = bitcast i8* %5 to i16*
%8 = load i16, i16* %7
%9 = icmp eq i16 %8, 0
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = and i16 %8, -258
%12 = icmp eq i16 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = tail call i32 @idct_dequant_full_2x_neon(i16* %0, i16* %1, i8* %2, i32 %4)
br label %18
15: ; preds = %10
%16 = load i16, i16* %1
%17 = tail call i32 @idct_dequant_0_2x_neon(i16* %0, i16 signext %16, i8* %2, i32 %4)
br label %18
18: ; preds = %13, %15, %6
%19 = getelementptr inbounds i16, i16* %0, i64 32
%20 = shl nsw i32 %4, 2
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %2, i64 %21
%23 = getelementptr inbounds i8, i8* %5, i64 2
%24 = bitcast i8* %23 to i16*
%25 = load i16, i16* %24
%26 = icmp eq i16 %25, 0
br i1 %26, label %35, label %27
27: ; preds = %18
%28 = and i16 %25, -258
%29 = icmp eq i16 %28, 0
br i1 %29, label %32, label %30
30: ; preds = %27
%31 = tail call i32 @idct_dequant_full_2x_neon(i16* %19, i16* %1, i8* %22, i32 %4)
br label %35
32: ; preds = %27
%33 = load i16, i16* %1
%34 = tail call i32 @idct_dequant_0_2x_neon(i16* %19, i16 signext %33, i8* %22, i32 %4)
br label %35
35: ; preds = %30, %32, %18
%36 = getelementptr inbounds i16, i16* %0, i64 64
%37 = getelementptr inbounds i8, i8* %5, i64 4
%38 = bitcast i8* %37 to i16*
%39 = load i16, i16* %38
%40 = icmp eq i16 %39, 0
br i1 %40, label %49, label %41
41: ; preds = %35
%42 = and i16 %39, -258
%43 = icmp eq i16 %42, 0
br i1 %43, label %46, label %44
44: ; preds = %41
%45 = tail call i32 @idct_dequant_full_2x_neon(i16* %36, i16* %1, i8* %3, i32 %4)
br label %49
46: ; preds = %41
%47 = load i16, i16* %1
%48 = tail call i32 @idct_dequant_0_2x_neon(i16* %36, i16 signext %47, i8* %3, i32 %4)
br label %49
49: ; preds = %44, %46, %35
%50 = getelementptr inbounds i16, i16* %0, i64 96
%51 = getelementptr inbounds i8, i8* %3, i64 %21
%52 = getelementptr inbounds i8, i8* %5, i64 6
%53 = bitcast i8* %52 to i16*
%54 = load i16, i16* %53
%55 = icmp eq i16 %54, 0
br i1 %55, label %64, label %56
56: ; preds = %49
%57 = and i16 %54, -258
%58 = icmp eq i16 %57, 0
br i1 %58, label %61, label %59
59: ; preds = %56
%60 = tail call i32 @idct_dequant_full_2x_neon(i16* %50, i16* %1, i8* %51, i32 %4)
br label %64
61: ; preds = %56
%62 = load i16, i16* %1
%63 = tail call i32 @idct_dequant_0_2x_neon(i16* %50, i16 signext %62, i8* %51, i32 %4)
br label %64
64: ; preds = %59, %61, %49
ret void
}