#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*/ CodecPageSelect(int);
int /*<<< orphan*/ CodecRegWrite(int, int);
int /*<<< orphan*/ CodecReset();
void ConfigureTiCodecMic(unsigned long ulWordLength) {
  CodecReset();
  CodecPageSelect(0);
  CodecRegWrite(0x1b, ulWordLength);
  CodecRegWrite(0x12, 0x84);
  CodecRegWrite(0x13, 0x84);
  CodecRegWrite(0x14, 0x30);
  CodecPageSelect(1);
  CodecRegWrite(0x2e, 0x09);
  CodecRegWrite(0x2f, 0x00);
  CodecRegWrite(0x30, 0x20);
  CodecRegWrite(0x31, 0x40);
  CodecPageSelect(0);
  CodecRegWrite(0x40, 0x0C);
  CodecRegWrite(0x51, 0x80);
  CodecRegWrite(0x52, 0x00);
  CodecRegWrite(0x53, 0x18);
}


x86 assembly (clang, -O0):
<ConfigureTiCodecMic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <CodecReset@plt>
xor    %edi,%edi
call   1050 <CodecPageSelect@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%esi
mov    $0x1b,%edi
call   1040 <CodecRegWrite@plt>
mov    $0x12,%edi
mov    $0x84,%esi
call   1040 <CodecRegWrite@plt>
mov    $0x13,%edi
mov    $0x84,%esi
call   1040 <CodecRegWrite@plt>
mov    $0x14,%edi
mov    $0x30,%esi
call   1040 <CodecRegWrite@plt>
mov    $0x1,%edi
call   1050 <CodecPageSelect@plt>
mov    $0x2e,%edi
mov    $0x9,%esi
call   1040 <CodecRegWrite@plt>
mov    $0x2f,%edi
xor    %esi,%esi
call   1040 <CodecRegWrite@plt>
mov    $0x30,%edi
mov    $0x20,%esi
call   1040 <CodecRegWrite@plt>
mov    $0x31,%edi
mov    $0x40,%esi
call   1040 <CodecRegWrite@plt>
xor    %edi,%edi
call   1050 <CodecPageSelect@plt>
mov    $0x40,%edi
mov    $0xc,%esi
call   1040 <CodecRegWrite@plt>
mov    $0x51,%edi
mov    $0x80,%esi
call   1040 <CodecRegWrite@plt>
mov    $0x52,%edi
xor    %esi,%esi
call   1040 <CodecRegWrite@plt>
mov    $0x53,%edi
mov    $0x18,%esi
call   1040 <CodecRegWrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConfigureTiCodecMic>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <CodecReset@plt>
xor    %edi,%edi
call   1050 <CodecPageSelect@plt>
mov    $0x1b,%edi
mov    %ebx,%esi
call   1040 <CodecRegWrite@plt>
mov    $0x12,%edi
mov    $0x84,%esi
call   1040 <CodecRegWrite@plt>
mov    $0x13,%edi
mov    $0x84,%esi
call   1040 <CodecRegWrite@plt>
mov    $0x14,%edi
mov    $0x30,%esi
call   1040 <CodecRegWrite@plt>
mov    $0x1,%edi
call   1050 <CodecPageSelect@plt>
mov    $0x2e,%edi
mov    $0x9,%esi
call   1040 <CodecRegWrite@plt>
mov    $0x2f,%edi
xor    %esi,%esi
call   1040 <CodecRegWrite@plt>
mov    $0x30,%edi
mov    $0x20,%esi
call   1040 <CodecRegWrite@plt>
mov    $0x31,%edi
mov    $0x40,%esi
call   1040 <CodecRegWrite@plt>
xor    %edi,%edi
call   1050 <CodecPageSelect@plt>
mov    $0x40,%edi
mov    $0xc,%esi
call   1040 <CodecRegWrite@plt>
mov    $0x51,%edi
mov    $0x80,%esi
call   1040 <CodecRegWrite@plt>
mov    $0x52,%edi
xor    %esi,%esi
call   1040 <CodecRegWrite@plt>
mov    $0x53,%edi
mov    $0x18,%esi
pop    %rbx
jmp    1040 <CodecRegWrite@plt>

LLVM IR (-O0):
define void @ConfigureTiCodecMic(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 (...) @CodecReset()
%4 = call i32 @CodecPageSelect(i32 0)
%5 = load i64, i64* %2
%6 = trunc i64 %5 to i32
%7 = call i32 @CodecRegWrite(i32 27, i32 %6)
%8 = call i32 @CodecRegWrite(i32 18, i32 132)
%9 = call i32 @CodecRegWrite(i32 19, i32 132)
%10 = call i32 @CodecRegWrite(i32 20, i32 48)
%11 = call i32 @CodecPageSelect(i32 1)
%12 = call i32 @CodecRegWrite(i32 46, i32 9)
%13 = call i32 @CodecRegWrite(i32 47, i32 0)
%14 = call i32 @CodecRegWrite(i32 48, i32 32)
%15 = call i32 @CodecRegWrite(i32 49, i32 64)
%16 = call i32 @CodecPageSelect(i32 0)
%17 = call i32 @CodecRegWrite(i32 64, i32 12)
%18 = call i32 @CodecRegWrite(i32 81, i32 128)
%19 = call i32 @CodecRegWrite(i32 82, i32 0)
%20 = call i32 @CodecRegWrite(i32 83, i32 24)
ret void
}

LLVM IR (-O2):
define void @ConfigureTiCodecMic(i64 %0) {
%2 = tail call i32 (...) @CodecReset()
%3 = tail call i32 @CodecPageSelect(i32 0)
%4 = trunc i64 %0 to i32
%5 = tail call i32 @CodecRegWrite(i32 27, i32 %4)
%6 = tail call i32 @CodecRegWrite(i32 18, i32 132)
%7 = tail call i32 @CodecRegWrite(i32 19, i32 132)
%8 = tail call i32 @CodecRegWrite(i32 20, i32 48)
%9 = tail call i32 @CodecPageSelect(i32 1)
%10 = tail call i32 @CodecRegWrite(i32 46, i32 9)
%11 = tail call i32 @CodecRegWrite(i32 47, i32 0)
%12 = tail call i32 @CodecRegWrite(i32 48, i32 32)
%13 = tail call i32 @CodecRegWrite(i32 49, i32 64)
%14 = tail call i32 @CodecPageSelect(i32 0)
%15 = tail call i32 @CodecRegWrite(i32 64, i32 12)
%16 = tail call i32 @CodecRegWrite(i32 81, i32 128)
%17 = tail call i32 @CodecRegWrite(i32 82, i32 0)
%18 = tail call i32 @CodecRegWrite(i32 83, i32 24)
ret void
}