#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*/ AuvitekTuner_ReadReg(int /*<<< orphan*/, int,
                                        unsigned char *);
int /*<<< orphan*/ AuvitekTuner_WriteReg(int /*<<< orphan*/, int,
                                         unsigned char);
void AuvitekTuner_ResetTuner(void *DevHandle) {
  unsigned char bDate = 0;
  unsigned char bDateRead = 0;
  AuvitekTuner_WriteReg(0, 0xe0, 0xdf);
  AuvitekTuner_ReadReg(0, 0xe2, &bDateRead);
  bDate = bDateRead | 0x2;
  AuvitekTuner_WriteReg(0, 0xe2, bDate);
  bDate = bDateRead & 0xfd;
  AuvitekTuner_WriteReg(0, 0xe2, bDate);
  bDate = bDateRead | 0x2;
  AuvitekTuner_WriteReg(0, 0xe2, bDate);
}


x86 assembly (clang, -O0):
<AuvitekTuner_ResetTuner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
movb   $0x0,-0xa(%rbp)
xor    %edi,%edi
mov    $0xe0,%esi
mov    $0xdf,%edx
call   1030 <AuvitekTuner_WriteReg@plt>
xor    %edi,%edi
mov    $0xe2,%esi
lea    -0xa(%rbp),%rdx
call   1040 <AuvitekTuner_ReadReg@plt>
movzbl -0xa(%rbp),%eax
or     $0x2,%eax
mov    %al,-0x9(%rbp)
xor    %edi,%edi
mov    $0xe2,%esi
movzbl -0x9(%rbp),%edx
call   1030 <AuvitekTuner_WriteReg@plt>
movzbl -0xa(%rbp),%eax
and    $0xfd,%eax
mov    %al,-0x9(%rbp)
xor    %edi,%edi
mov    $0xe2,%esi
movzbl -0x9(%rbp),%edx
call   1030 <AuvitekTuner_WriteReg@plt>
movzbl -0xa(%rbp),%eax
or     $0x2,%eax
mov    %al,-0x9(%rbp)
xor    %edi,%edi
mov    $0xe2,%esi
movzbl -0x9(%rbp),%edx
call   1030 <AuvitekTuner_WriteReg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AuvitekTuner_ResetTuner>:
push   %rax
movb   $0x0,0x7(%rsp)
xor    %edi,%edi
mov    $0xe0,%esi
mov    $0xdf,%edx
call   1030 <AuvitekTuner_WriteReg@plt>
lea    0x7(%rsp),%rdx
xor    %edi,%edi
mov    $0xe2,%esi
call   1040 <AuvitekTuner_ReadReg@plt>
movzbl 0x7(%rsp),%edx
or     $0x2,%edx
xor    %edi,%edi
mov    $0xe2,%esi
call   1030 <AuvitekTuner_WriteReg@plt>
movzbl 0x7(%rsp),%edx
and    $0xfffffffd,%edx
xor    %edi,%edi
mov    $0xe2,%esi
call   1030 <AuvitekTuner_WriteReg@plt>
movzbl 0x7(%rsp),%edx
or     $0x2,%edx
xor    %edi,%edi
mov    $0xe2,%esi
call   1030 <AuvitekTuner_WriteReg@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @AuvitekTuner_ResetTuner(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
store i8 0, i8* %3
store i8 0, i8* %4
%5 = call i32 @AuvitekTuner_WriteReg(i32 0, i32 224, i8 zeroext -33)
%6 = call i32 @AuvitekTuner_ReadReg(i32 0, i32 226, i8* %4)
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = or i32 %8, 2
%10 = trunc i32 %9 to i8
store i8 %10, i8* %3
%11 = load i8, i8* %3
%12 = call i32 @AuvitekTuner_WriteReg(i32 0, i32 226, i8 zeroext %11)
%13 = load i8, i8* %4
%14 = zext i8 %13 to i32
%15 = and i32 %14, 253
%16 = trunc i32 %15 to i8
store i8 %16, i8* %3
%17 = load i8, i8* %3
%18 = call i32 @AuvitekTuner_WriteReg(i32 0, i32 226, i8 zeroext %17)
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %20, 2
%22 = trunc i32 %21 to i8
store i8 %22, i8* %3
%23 = load i8, i8* %3
%24 = call i32 @AuvitekTuner_WriteReg(i32 0, i32 226, i8 zeroext %23)
ret void
}

LLVM IR (-O2):
define void @AuvitekTuner_ResetTuner(i8* nocapture readnone %0) {
%2 = alloca i8
store i8 0, i8* %2
%3 = tail call i32 @AuvitekTuner_WriteReg(i32 0, i32 224, i8 zeroext -33)
%4 = call i32 @AuvitekTuner_ReadReg(i32 0, i32 226, i8* %2)
%5 = load i8, i8* %2
%6 = or i8 %5, 2
%7 = call i32 @AuvitekTuner_WriteReg(i32 0, i32 226, i8 zeroext %6)
%8 = load i8, i8* %2
%9 = and i8 %8, -3
%10 = call i32 @AuvitekTuner_WriteReg(i32 0, i32 226, i8 zeroext %9)
%11 = load i8, i8* %2
%12 = or i8 %11, 2
%13 = call i32 @AuvitekTuner_WriteReg(i32 0, i32 226, i8 zeroext %12)
ret void
}