#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*/ viqe_set_deintl_region(int, int /*<<< orphan*/, unsigned int,
                                          int /*<<< orphan*/, unsigned int);
int /*<<< orphan*/ viqe_set_dnsp_region(int, int, unsigned int);
int /*<<< orphan*/ viqe_set_dnts_region(int, int, unsigned int);
int /*<<< orphan*/ viqe_set_gamut_region(int, int /*<<< orphan*/, unsigned int,
                                         int /*<<< orphan*/, unsigned int);
int /*<<< orphan*/ viqe_set_his_region(int, int /*<<< orphan*/, unsigned int,
                                       int /*<<< orphan*/, unsigned int);
void VIQE_SetProcessingRegion(int HalfFlag, unsigned int Width,
                              unsigned int Height) {
  viqe_set_deintl_region(HalfFlag, 0, Width / 2, 0, Height);
  viqe_set_dnts_region(HalfFlag, 1, Width / 2);
  viqe_set_dnsp_region(HalfFlag, 1, Width / 2);
  if (HalfFlag == 1)
    viqe_set_gamut_region(1, 0, Width / 2, 0, Height);
  else
    viqe_set_gamut_region(1, 0, 0, 0, Height);
  viqe_set_his_region(HalfFlag, 0, Width / 2, 0, Height);
  return;
}


x86 assembly (clang, -O0):
<VIQE_SetProcessingRegion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
shr    $0x1,%edx
mov    -0xc(%rbp),%r8d
xor    %ecx,%ecx
mov    %ecx,%esi
call   1060 <viqe_set_deintl_region@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
shr    $0x1,%edx
mov    $0x1,%esi
call   1040 <viqe_set_dnts_region@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
shr    $0x1,%edx
mov    $0x1,%esi
call   1050 <viqe_set_dnsp_region@plt>
cmpl   $0x1,-0x4(%rbp)
jne    11c4 <VIQE_SetProcessingRegion+0x74>
mov    -0x8(%rbp),%edx
shr    $0x1,%edx
mov    -0xc(%rbp),%r8d
mov    $0x1,%edi
xor    %ecx,%ecx
mov    %ecx,%esi
call   1030 <viqe_set_gamut_region@plt>
jmp    11d8 <VIQE_SetProcessingRegion+0x88>
mov    -0xc(%rbp),%r8d
mov    $0x1,%edi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <viqe_set_gamut_region@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
shr    $0x1,%edx
mov    -0xc(%rbp),%r8d
xor    %ecx,%ecx
mov    %ecx,%esi
call   1070 <viqe_set_his_region@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIQE_SetProcessingRegion>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
shr    %ebp
xor    %r15d,%r15d
xor    %esi,%esi
mov    %ebp,%edx
xor    %ecx,%ecx
mov    %r14d,%r8d
call   1060 <viqe_set_deintl_region@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    %ebp,%edx
call   1040 <viqe_set_dnts_region@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    %ebp,%edx
call   1050 <viqe_set_dnsp_region@plt>
cmp    $0x1,%ebx
cmove  %ebp,%r15d
mov    $0x1,%edi
xor    %esi,%esi
mov    %r15d,%edx
xor    %ecx,%ecx
mov    %r14d,%r8d
call   1030 <viqe_set_gamut_region@plt>
mov    %ebx,%edi
xor    %esi,%esi
mov    %ebp,%edx
xor    %ecx,%ecx
mov    %r14d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1070 <viqe_set_his_region@plt>

LLVM IR (-O0):
define void @VIQE_SetProcessingRegion(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = udiv i32 %8, 2
%10 = load i32, i32* %6
%11 = call i32 @viqe_set_deintl_region(i32 %7, i32 0, i32 %9, i32 0, i32 %10)
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = udiv i32 %13, 2
%15 = call i32 @viqe_set_dnts_region(i32 %12, i32 1, i32 %14)
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = udiv i32 %17, 2
%19 = call i32 @viqe_set_dnsp_region(i32 %16, i32 1, i32 %18)
%20 = load i32, i32* %4
%21 = icmp eq i32 %20, 1
br i1 %21, label %22, label %27
22: ; preds = %3
%23 = load i32, i32* %5
%24 = udiv i32 %23, 2
%25 = load i32, i32* %6
%26 = call i32 @viqe_set_gamut_region(i32 1, i32 0, i32 %24, i32 0, i32 %25)
br label %30
27: ; preds = %3
%28 = load i32, i32* %6
%29 = call i32 @viqe_set_gamut_region(i32 1, i32 0, i32 0, i32 0, i32 %28)
br label %30
30: ; preds = %27, %22
%31 = load i32, i32* %4
%32 = load i32, i32* %5
%33 = udiv i32 %32, 2
%34 = load i32, i32* %6
%35 = call i32 @viqe_set_his_region(i32 %31, i32 0, i32 %33, i32 0, i32 %34)
ret void
}

LLVM IR (-O2):
define void @VIQE_SetProcessingRegion(i32 %0, i32 %1, i32 %2) {
%4 = lshr i32 %1, 1
%5 = tail call i32 @viqe_set_deintl_region(i32 %0, i32 0, i32 %4, i32 0, i32 %2)
%6 = tail call i32 @viqe_set_dnts_region(i32 %0, i32 1, i32 %4)
%7 = tail call i32 @viqe_set_dnsp_region(i32 %0, i32 1, i32 %4)
%8 = icmp eq i32 %0, 1
%9 = select i1 %8, i32 %4, i32 0
%10 = tail call i32 @viqe_set_gamut_region(i32 1, i32 0, i32 %9, i32 0, i32 %2)
%11 = tail call i32 @viqe_set_his_region(i32 %0, i32 0, i32 %4, i32 0, i32 %2)
ret void
}