#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 getSbrTuningTableIndex(unsigned int, unsigned int, unsigned int);
unsigned int IsSbrSettingAvail(unsigned int bitrate,
                               unsigned int numOutputChannels,
                               unsigned int sampleRateInput,
                               unsigned int *sampleRateCore) {
  int idx = -1;
  ;
  ;
  ;
  ;
  if (sampleRateInput < 32000) {
    ;
    return 0;
  };
  ;
  *sampleRateCore = sampleRateInput / 2;
  ;
  idx = getSbrTuningTableIndex(bitrate, numOutputChannels, *sampleRateCore);
  ;
  ;
  ;
  return (idx == -1) ? 0 : 1;
}


x86 assembly (clang, -O0):
<IsSbrSettingAvail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
cmpl   $0x7d00,-0x10(%rbp)
jae    1145 <IsSbrSettingAvail+0x35>
movl   $0x0,-0x4(%rbp)
jmp    1178 <IsSbrSettingAvail+0x68>
mov    -0x10(%rbp),%ecx
shr    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
call   1030 <getSbrTuningTableIndex@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0xffffffff,%edx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsSbrSettingAvail>:
xor    %eax,%eax
cmp    $0x7d00,%edx
jb     1132 <IsSbrSettingAvail+0x22>
push   %rax
shr    %edx
mov    %edx,(%rcx)
call   1030 <getSbrTuningTableIndex@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @IsSbrSettingAvail(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32* %3, i32** %9
store i32 -1, i32* %10
%11 = load i32, i32* %8
%12 = icmp ult i32 %11, 32000
br i1 %12, label %13, label %14
13: ; preds = %4
store i32 0, i32* %5
br label %27
14: ; preds = %4
%15 = load i32, i32* %8
%16 = udiv i32 %15, 2
%17 = load i32*, i32** %9
store i32 %16, i32* %17
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = load i32*, i32** %9
%21 = load i32, i32* %20
%22 = call i32 @getSbrTuningTableIndex(i32 %18, i32 %19, i32 %21)
store i32 %22, i32* %10
%23 = load i32, i32* %10
%24 = icmp eq i32 %23, -1
%25 = zext i1 %24 to i64
%26 = select i1 %24, i32 0, i32 1
store i32 %26, i32* %5
br label %27
27: ; preds = %14, %13
%28 = load i32, i32* %5
ret i32 %28
}

LLVM IR (-O2):
define i32 @IsSbrSettingAvail(i32 %0, i32 %1, i32 %2, i32* nocapture writeonly %3) {
%5 = icmp ult i32 %2, 32000
br i1 %5, label %11, label %6
6: ; preds = %4
%7 = lshr i32 %2, 1
store i32 %7, i32* %3
%8 = tail call i32 @getSbrTuningTableIndex(i32 %0, i32 %1, i32 %7)
%9 = icmp ne i32 %8, -1
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %6
%12 = phi i32 [ %10, %6 ], [ 0, %4 ]
ret i32 %12
}