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


x86 assembly (clang, -O0):
<vp8_dequant_idct_add_uv_block_sse2>:
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     1195 <vp8_dequant_idct_add_uv_block_sse2+0x75>
mov    -0x30(%rbp),%rax
movswl (%rax),%eax
and    $0xfefe,%eax
cmp    $0x0,%eax
je     117c <vp8_dequant_idct_add_uv_block_sse2+0x5c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1030 <vp8_idct_dequant_full_2x_sse2@plt>
jmp    1190 <vp8_dequant_idct_add_uv_block_sse2+0x70>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1040 <vp8_idct_dequant_0_2x_sse2@plt>
jmp    1195 <vp8_dequant_idct_add_uv_block_sse2+0x75>
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     120c <vp8_dequant_idct_add_uv_block_sse2+0xec>
mov    -0x30(%rbp),%rax
movswl 0x2(%rax),%eax
and    $0xfefe,%eax
cmp    $0x0,%eax
je     11f3 <vp8_dequant_idct_add_uv_block_sse2+0xd3>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1030 <vp8_idct_dequant_full_2x_sse2@plt>
jmp    1207 <vp8_dequant_idct_add_uv_block_sse2+0xe7>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1040 <vp8_idct_dequant_0_2x_sse2@plt>
jmp    120c <vp8_dequant_idct_add_uv_block_sse2+0xec>
mov    -0x8(%rbp),%rax
add    $0x40,%rax
mov    %rax,-0x8(%rbp)
mov    -0x30(%rbp),%rax
cmpw   $0x0,0x4(%rax)
je     126f <vp8_dequant_idct_add_uv_block_sse2+0x14f>
mov    -0x30(%rbp),%rax
movswl 0x4(%rax),%eax
and    $0xfefe,%eax
cmp    $0x0,%eax
je     1256 <vp8_dequant_idct_add_uv_block_sse2+0x136>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1030 <vp8_idct_dequant_full_2x_sse2@plt>
jmp    126a <vp8_dequant_idct_add_uv_block_sse2+0x14a>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1040 <vp8_idct_dequant_0_2x_sse2@plt>
jmp    126f <vp8_dequant_idct_add_uv_block_sse2+0x14f>
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     12e6 <vp8_dequant_idct_add_uv_block_sse2+0x1c6>
mov    -0x30(%rbp),%rax
movswl 0x6(%rax),%eax
and    $0xfefe,%eax
cmp    $0x0,%eax
je     12cd <vp8_dequant_idct_add_uv_block_sse2+0x1ad>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1030 <vp8_idct_dequant_full_2x_sse2@plt>
jmp    12e1 <vp8_dequant_idct_add_uv_block_sse2+0x1c1>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1040 <vp8_idct_dequant_0_2x_sse2@plt>
jmp    12e6 <vp8_dequant_idct_add_uv_block_sse2+0x1c6>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vp8_dequant_idct_add_uv_block_sse2>:
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     1165 <vp8_dequant_idct_add_uv_block_sse2+0x45>
mov    %r13,%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
mov    %r12d,%ecx
test   $0xfefe,%eax
je     1160 <vp8_dequant_idct_add_uv_block_sse2+0x40>
call   1030 <vp8_idct_dequant_full_2x_sse2@plt>
jmp    1165 <vp8_dequant_idct_add_uv_block_sse2+0x45>
call   1040 <vp8_idct_dequant_0_2x_sse2@plt>
lea    0x0(,%r12,4),%eax
cltq
mov    %rax,(%rsp)
movzwl 0x2(%rbx),%eax
test   %ax,%ax
je     11a0 <vp8_dequant_idct_add_uv_block_sse2+0x80>
lea    0x40(%r13),%rdi
add    (%rsp),%rbp
mov    %r15,%rsi
mov    %rbp,%rdx
mov    %r12d,%ecx
test   $0xfefe,%eax
je     119b <vp8_dequant_idct_add_uv_block_sse2+0x7b>
call   1030 <vp8_idct_dequant_full_2x_sse2@plt>
jmp    11a0 <vp8_dequant_idct_add_uv_block_sse2+0x80>
call   1040 <vp8_idct_dequant_0_2x_sse2@plt>
movzwl 0x4(%rbx),%eax
test   %ax,%ax
je     11cc <vp8_dequant_idct_add_uv_block_sse2+0xac>
lea    0x80(%r13),%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %r12d,%ecx
test   $0xfefe,%eax
je     11c7 <vp8_dequant_idct_add_uv_block_sse2+0xa7>
call   1030 <vp8_idct_dequant_full_2x_sse2@plt>
jmp    11cc <vp8_dequant_idct_add_uv_block_sse2+0xac>
call   1040 <vp8_idct_dequant_0_2x_sse2@plt>
movzwl 0x6(%rbx),%eax
test   %ax,%ax
je     1206 <vp8_dequant_idct_add_uv_block_sse2+0xe6>
add    $0xc0,%r13
add    (%rsp),%r14
mov    %r13,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %r12d,%ecx
add    $0x8,%rsp
test   $0xfefe,%eax
je     1215 <vp8_dequant_idct_add_uv_block_sse2+0xf5>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <vp8_idct_dequant_full_2x_sse2@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <vp8_idct_dequant_0_2x_sse2@plt>

LLVM IR (-O0):
define void @vp8_dequant_idct_add_uv_block_sse2(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 %39
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 @vp8_idct_dequant_full_2x_sse2(i16* %27, i16* %28, i8* %29, i32 %30)
br label %38
32: ; preds = %18
%33 = load i16*, i16** %7
%34 = load i16*, i16** %8
%35 = load i8*, i8** %9
%36 = load i32, i32* %11
%37 = call i32 @vp8_idct_dequant_0_2x_sse2(i16* %33, i16* %34, i8* %35, i32 %36)
br label %38
38: ; preds = %32, %26
br label %39
39: ; preds = %38, %6
%40 = load i16*, i16** %7
%41 = getelementptr inbounds i16, i16* %40, i64 32
store i16* %41, i16** %7
%42 = load i32, i32* %11
%43 = mul nsw i32 %42, 4
%44 = load i8*, i8** %9
%45 = sext i32 %43 to i64
%46 = getelementptr inbounds i8, i8* %44, i64 %45
store i8* %46, i8** %9
%47 = load i8*, i8** %12
%48 = bitcast i8* %47 to i16*
%49 = getelementptr inbounds i16, i16* %48, i64 1
%50 = load i16, i16* %49
%51 = icmp ne i16 %50, 0
br i1 %51, label %52, label %73
52: ; preds = %39
%53 = load i8*, i8** %12
%54 = bitcast i8* %53 to i16*
%55 = getelementptr inbounds i16, i16* %54, i64 1
%56 = load i16, i16* %55
%57 = sext i16 %56 to i32
%58 = and i32 %57, 65278
%59 = icmp ne i32 %58, 0
br i1 %59, label %60, label %66
60: ; preds = %52
%61 = load i16*, i16** %7
%62 = load i16*, i16** %8
%63 = load i8*, i8** %9
%64 = load i32, i32* %11
%65 = call i32 @vp8_idct_dequant_full_2x_sse2(i16* %61, i16* %62, i8* %63, i32 %64)
br label %72
66: ; preds = %52
%67 = load i16*, i16** %7
%68 = load i16*, i16** %8
%69 = load i8*, i8** %9
%70 = load i32, i32* %11
%71 = call i32 @vp8_idct_dequant_0_2x_sse2(i16* %67, i16* %68, i8* %69, i32 %70)
br label %72
72: ; preds = %66, %60
br label %73
73: ; preds = %72, %39
%74 = load i16*, i16** %7
%75 = getelementptr inbounds i16, i16* %74, i64 32
store i16* %75, i16** %7
%76 = load i8*, i8** %12
%77 = bitcast i8* %76 to i16*
%78 = getelementptr inbounds i16, i16* %77, i64 2
%79 = load i16, i16* %78
%80 = icmp ne i16 %79, 0
br i1 %80, label %81, label %102
81: ; preds = %73
%82 = load i8*, i8** %12
%83 = bitcast i8* %82 to i16*
%84 = getelementptr inbounds i16, i16* %83, i64 2
%85 = load i16, i16* %84
%86 = sext i16 %85 to i32
%87 = and i32 %86, 65278
%88 = icmp ne i32 %87, 0
br i1 %88, label %89, label %95
89: ; preds = %81
%90 = load i16*, i16** %7
%91 = load i16*, i16** %8
%92 = load i8*, i8** %10
%93 = load i32, i32* %11
%94 = call i32 @vp8_idct_dequant_full_2x_sse2(i16* %90, i16* %91, i8* %92, i32 %93)
br label %101
95: ; preds = %81
%96 = load i16*, i16** %7
%97 = load i16*, i16** %8
%98 = load i8*, i8** %10
%99 = load i32, i32* %11
%100 = call i32 @vp8_idct_dequant_0_2x_sse2(i16* %96, i16* %97, i8* %98, i32 %99)
br label %101
101: ; preds = %95, %89
br label %102
102: ; preds = %101, %73
%103 = load i16*, i16** %7
%104 = getelementptr inbounds i16, i16* %103, i64 32
store i16* %104, i16** %7
%105 = load i32, i32* %11
%106 = mul nsw i32 %105, 4
%107 = load i8*, i8** %10
%108 = sext i32 %106 to i64
%109 = getelementptr inbounds i8, i8* %107, i64 %108
store i8* %109, i8** %10
%110 = load i8*, i8** %12
%111 = bitcast i8* %110 to i16*
%112 = getelementptr inbounds i16, i16* %111, i64 3
%113 = load i16, i16* %112
%114 = icmp ne i16 %113, 0
br i1 %114, label %115, label %136
115: ; preds = %102
%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 = sext i16 %119 to i32
%121 = and i32 %120, 65278
%122 = icmp ne i32 %121, 0
br i1 %122, label %123, label %129
123: ; preds = %115
%124 = load i16*, i16** %7
%125 = load i16*, i16** %8
%126 = load i8*, i8** %10
%127 = load i32, i32* %11
%128 = call i32 @vp8_idct_dequant_full_2x_sse2(i16* %124, i16* %125, i8* %126, i32 %127)
br label %135
129: ; preds = %115
%130 = load i16*, i16** %7
%131 = load i16*, i16** %8
%132 = load i8*, i8** %10
%133 = load i32, i32* %11
%134 = call i32 @vp8_idct_dequant_0_2x_sse2(i16* %130, i16* %131, i8* %132, i32 %133)
br label %135
135: ; preds = %129, %123
br label %136
136: ; preds = %135, %102
ret void
}

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