#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 */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int sbc_encoder_process_input_s8_internal(int, int /*<<< orphan*/ const *,
                                          int /*<<< orphan*/ **, int, int,
                                          int /*<<< orphan*/);
int sbc_enc_process_input_8s_le(int position, const uint8_t *pcm,
                                int16_t X[2][328], int nsamples,
                                int nchannels) {
  if (nchannels > 1)
    return sbc_encoder_process_input_s8_internal(position, pcm, X, nsamples, 2,
                                                 0);
  else
    return sbc_encoder_process_input_s8_internal(position, pcm, X, nsamples, 1,
                                                 0);
}


x86 assembly (clang, -O0):
<sbc_enc_process_input_8s_le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
cmpl   $0x1,-0x20(%rbp)
jle    1158 <sbc_enc_process_input_8s_le+0x48>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x2,%r8d
xor    %r9d,%r9d
call   1030 <sbc_encoder_process_input_s8_internal@plt>
mov    %eax,-0x4(%rbp)
jmp    1177 <sbc_enc_process_input_8s_le+0x67>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x1,%r8d
xor    %r9d,%r9d
call   1030 <sbc_encoder_process_input_s8_internal@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbc_enc_process_input_8s_le>:
xor    %eax,%eax
cmp    $0x2,%r8d
setge  %al
add    $0x1,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
jmp    1030 <sbc_encoder_process_input_s8_internal@plt>

LLVM IR (-O0):
define i32 @sbc_enc_process_input_8s_le(i32 %0, i32* %1, [328 x i32]* %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca [328 x i32]*
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %7
store i32* %1, i32** %8
store [328 x i32]* %2, [328 x i32]** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
%12 = load i32, i32* %11
%13 = icmp sgt i32 %12, 1
br i1 %13, label %14, label %21
14: ; preds = %5
%15 = load i32, i32* %7
%16 = load i32*, i32** %8
%17 = load [328 x i32]*, [328 x i32]** %9
%18 = bitcast [328 x i32]* %17 to i32**
%19 = load i32, i32* %10
%20 = call i32 @sbc_encoder_process_input_s8_internal(i32 %15, i32* %16, i32** %18, i32 %19, i32 2, i32 0)
store i32 %20, i32* %6
br label %28
21: ; preds = %5
%22 = load i32, i32* %7
%23 = load i32*, i32** %8
%24 = load [328 x i32]*, [328 x i32]** %9
%25 = bitcast [328 x i32]* %24 to i32**
%26 = load i32, i32* %10
%27 = call i32 @sbc_encoder_process_input_s8_internal(i32 %22, i32* %23, i32** %25, i32 %26, i32 1, i32 0)
store i32 %27, i32* %6
br label %28
28: ; preds = %21, %14
%29 = load i32, i32* %6
ret i32 %29
}

LLVM IR (-O2):
define i32 @sbc_enc_process_input_8s_le(i32 %0, i32* %1, [328 x i32]* %2, i32 %3, i32 %4) {
%6 = icmp sgt i32 %4, 1
%7 = bitcast [328 x i32]* %2 to i32**
%8 = select i1 %6, i32 2, i32 1
%9 = tail call i32 @sbc_encoder_process_input_s8_internal(i32 %0, i32* %1, i32** %7, i32 %3, i32 %8, i32 0)
ret i32 %9
}