#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*/ FILE;

/* Variables and functions */
int GetSymbol(int *, int *, int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ arithmetic_decode(int, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ arithmetic_decode_target(int);
int ArithDecodeSymbol(int nSymbols, int *counters, int totalCount, FILE *iFp) {
  int low, high;
  int symbol = GetSymbol(&low, &high, counters,
                         arithmetic_decode_target(totalCount), nSymbols);
  arithmetic_decode(low, high, totalCount, iFp);
  return symbol;
}


x86 assembly (clang, -O0):
<ArithDecodeSymbol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <arithmetic_decode_target@plt>
mov    -0x38(%rbp),%rdx
mov    %eax,%ecx
mov    -0x4(%rbp),%r8d
lea    -0x24(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1040 <GetSymbol@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1050 <arithmetic_decode@plt>
mov    -0x2c(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ArithDecodeSymbol>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %edi,%r15d
mov    %edx,%edi
call   1030 <arithmetic_decode_target@plt>
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
mov    %r15d,%r8d
call   1040 <GetSymbol@plt>
mov    %eax,%ebx
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
mov    %ebp,%edx
mov    %r14,%rcx
call   1050 <arithmetic_decode@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ArithDecodeSymbol(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
%11 = alloca i32
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%12 = load i32*, i32** %6
%13 = load i32, i32* %7
%14 = call i32 @arithmetic_decode_target(i32 %13)
%15 = load i32, i32* %5
%16 = call i32 @GetSymbol(i32* %9, i32* %10, i32* %12, i32 %14, i32 %15)
store i32 %16, i32* %11
%17 = load i32, i32* %9
%18 = load i32, i32* %10
%19 = load i32, i32* %7
%20 = load i32*, i32** %8
%21 = call i32 @arithmetic_decode(i32 %17, i32 %18, i32 %19, i32* %20)
%22 = load i32, i32* %11
ret i32 %22
}

LLVM IR (-O2):
define i32 @ArithDecodeSymbol(i32 %0, i32* %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %5 to i8*
%8 = bitcast i32* %6 to i8*
%9 = tail call i32 @arithmetic_decode_target(i32 %2)
%10 = call i32 @GetSymbol(i32* %5, i32* %6, i32* %1, i32 %9, i32 %0)
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = call i32 @arithmetic_decode(i32 %11, i32 %12, i32 %2, i32* %3)
ret i32 %10
}