#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*/ ClrGyr(int, int);
scalar_t__ GenMesMobile(int, int /*<<< orphan*/);
int /*<<< orphan*/ RamWrite32A(int, int);
int /*<<< orphan*/ RegWriteA(int, unsigned char);
int TneGvcMobile(void) {
  int SiRsltSts;
  unsigned short UsGxoVal, UsGyoVal;
  RegWriteA(0x02A0, 0x00);
  RegWriteA(0x02A1, 0x00);
  RegWriteA(0x02A2, 0x00);
  RegWriteA(0x02A3, 0x00);
  RamWrite32A(0x10F0, 0x3F800000);
  RamWrite32A(0x10F1, 0x00000000);
  RamWrite32A(0x10F2, 0x00000000);
  RamWrite32A(0x10F3, 0x00000000);
  RamWrite32A(0x10F4, 0x00000000);
  RamWrite32A(0x10F5, 0x3F800000);
  RamWrite32A(0x10F6, 0x00000000);
  RamWrite32A(0x10F7, 0x00000000);
  RamWrite32A(0x10F8, 0x00000000);
  RamWrite32A(0x10F9, 0x00000000);
  RamWrite32A(0x11F0, 0x3F800000);
  RamWrite32A(0x11F1, 0x00000000);
  RamWrite32A(0x11F2, 0x00000000);
  RamWrite32A(0x11F3, 0x00000000);
  RamWrite32A(0x11F4, 0x00000000);
  RamWrite32A(0x11F5, 0x3F800000);
  RamWrite32A(0x11F6, 0x00000000);
  RamWrite32A(0x11F7, 0x00000000);
  RamWrite32A(0x11F8, 0x00000000);
  RamWrite32A(0x11F9, 0x00000000);
  RegWriteA(0x0194, 0x00);
  RegWriteA(0x0195, 0x00);
  ClrGyr(0x1000, 0x02);
  UsGxoVal = (unsigned short)GenMesMobile(0x144A, 0);
  RegWriteA(0x02A0, (unsigned char)(UsGxoVal >> 8));
  RegWriteA(0x02A1, (unsigned char)(UsGxoVal));
  RegWriteA(0x0194, 0x00);
  RegWriteA(0x0195, 0x00);
  ClrGyr(0x1000, 0x02);
  UsGyoVal = (unsigned short)GenMesMobile(0x14CA, 0);
  RegWriteA(0x02A2, (unsigned char)(UsGyoVal >> 8));
  RegWriteA(0x02A3, (unsigned char)(UsGyoVal));
  SiRsltSts = 0x02;
  if (((signed short)UsGxoVal < (signed short)0xFD71) ||
      ((signed short)UsGxoVal > (signed short)0x028F)) {
    SiRsltSts |= 0x42;
  }
  if (((signed short)UsGyoVal < (signed short)0xFD71) ||
      ((signed short)UsGyoVal > (signed short)0x028F)) {
    SiRsltSts |= 0x82;
  }
  return (SiRsltSts);
}


x86 assembly (clang, -O0):
<TneGvcMobile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2a0,%edi
xor    %esi,%esi
call   1060 <RegWriteA@plt>
mov    $0x2a1,%edi
xor    %esi,%esi
call   1060 <RegWriteA@plt>
mov    $0x2a2,%edi
xor    %esi,%esi
call   1060 <RegWriteA@plt>
mov    $0x2a3,%edi
xor    %esi,%esi
call   1060 <RegWriteA@plt>
mov    $0x10f0,%edi
mov    $0x3f800000,%esi
call   1040 <RamWrite32A@plt>
mov    $0x10f1,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x10f2,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x10f3,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x10f4,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x10f5,%edi
mov    $0x3f800000,%esi
call   1040 <RamWrite32A@plt>
mov    $0x10f6,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x10f7,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x10f8,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x10f9,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x11f0,%edi
mov    $0x3f800000,%esi
call   1040 <RamWrite32A@plt>
mov    $0x11f1,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x11f2,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x11f3,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x11f4,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x11f5,%edi
mov    $0x3f800000,%esi
call   1040 <RamWrite32A@plt>
mov    $0x11f6,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x11f7,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x11f8,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x11f9,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x194,%edi
xor    %esi,%esi
call   1060 <RegWriteA@plt>
mov    $0x195,%edi
xor    %esi,%esi
call   1060 <RegWriteA@plt>
mov    $0x1000,%edi
mov    $0x2,%esi
call   1030 <ClrGyr@plt>
mov    $0x144a,%edi
xor    %esi,%esi
call   1050 <GenMesMobile@plt>
mov    %ax,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
sar    $0x8,%eax
mov    $0x2a0,%edi
movzbl %al,%esi
call   1060 <RegWriteA@plt>
mov    -0x6(%rbp),%ax
mov    $0x2a1,%edi
movzbl %al,%esi
call   1060 <RegWriteA@plt>
mov    $0x194,%edi
xor    %esi,%esi
call   1060 <RegWriteA@plt>
mov    $0x195,%edi
xor    %esi,%esi
call   1060 <RegWriteA@plt>
mov    $0x1000,%edi
mov    $0x2,%esi
call   1030 <ClrGyr@plt>
mov    $0x14ca,%edi
xor    %esi,%esi
call   1050 <GenMesMobile@plt>
mov    %ax,-0x8(%rbp)
movzwl -0x8(%rbp),%eax
sar    $0x8,%eax
mov    $0x2a2,%edi
movzbl %al,%esi
call   1060 <RegWriteA@plt>
mov    -0x8(%rbp),%ax
mov    $0x2a3,%edi
movzbl %al,%esi
call   1060 <RegWriteA@plt>
movl   $0x2,-0x4(%rbp)
movswl -0x6(%rbp),%eax
cmp    $0xfffffd71,%eax
jl     1351 <TneGvcMobile+0x211>
movswl -0x6(%rbp),%eax
cmp    $0x28f,%eax
jle    135a <TneGvcMobile+0x21a>
mov    -0x4(%rbp),%eax
or     $0x42,%eax
mov    %eax,-0x4(%rbp)
movswl -0x8(%rbp),%eax
cmp    $0xfffffd71,%eax
jl     1378 <TneGvcMobile+0x238>
movswl -0x8(%rbp),%eax
cmp    $0x28f,%eax
jle    1383 <TneGvcMobile+0x243>
mov    -0x4(%rbp),%eax
or     $0x82,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TneGvcMobile>:
push   %r14
push   %rbx
push   %rax
mov    $0x2a0,%edi
xor    %esi,%esi
call   1060 <RegWriteA@plt>
mov    $0x2a1,%edi
xor    %esi,%esi
call   1060 <RegWriteA@plt>
mov    $0x2a2,%edi
xor    %esi,%esi
call   1060 <RegWriteA@plt>
mov    $0x2a3,%edi
xor    %esi,%esi
call   1060 <RegWriteA@plt>
mov    $0x10f0,%edi
mov    $0x3f800000,%esi
call   1040 <RamWrite32A@plt>
mov    $0x10f1,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x10f2,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x10f3,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x10f4,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x10f5,%edi
mov    $0x3f800000,%esi
call   1040 <RamWrite32A@plt>
mov    $0x10f6,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x10f7,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x10f8,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x10f9,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x11f0,%edi
mov    $0x3f800000,%esi
call   1040 <RamWrite32A@plt>
mov    $0x11f1,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x11f2,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x11f3,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x11f4,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x11f5,%edi
mov    $0x3f800000,%esi
call   1040 <RamWrite32A@plt>
mov    $0x11f6,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x11f7,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x11f8,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x11f9,%edi
xor    %esi,%esi
call   1040 <RamWrite32A@plt>
mov    $0x194,%edi
xor    %esi,%esi
call   1060 <RegWriteA@plt>
mov    $0x195,%edi
xor    %esi,%esi
call   1060 <RegWriteA@plt>
mov    $0x1000,%edi
mov    $0x2,%esi
call   1030 <ClrGyr@plt>
mov    $0x144a,%edi
xor    %esi,%esi
call   1050 <GenMesMobile@plt>
mov    %rax,%rbx
movzbl %bh,%esi
mov    $0x2a0,%edi
call   1060 <RegWriteA@plt>
movzbl %bl,%esi
mov    %rbx,%r14
mov    $0x2a1,%edi
call   1060 <RegWriteA@plt>
mov    $0x194,%edi
xor    %esi,%esi
call   1060 <RegWriteA@plt>
mov    $0x195,%edi
xor    %esi,%esi
call   1060 <RegWriteA@plt>
mov    $0x1000,%edi
mov    $0x2,%esi
call   1030 <ClrGyr@plt>
mov    $0x14ca,%edi
xor    %esi,%esi
call   1050 <GenMesMobile@plt>
mov    %rax,%rbx
movzbl %bh,%esi
mov    $0x2a2,%edi
call   1060 <RegWriteA@plt>
movzbl %bl,%esi
mov    $0x2a3,%edi
call   1060 <RegWriteA@plt>
mov    %r14,%rax
shl    $0x10,%eax
add    $0xfd70ffff,%eax
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0xfae1ffff,%ecx
setb   %al
shl    $0x6,%eax
shl    $0x10,%ebx
add    $0xfd70ffff,%ebx
xor    %ecx,%ecx
cmp    $0xfae1ffff,%ebx
setb   %cl
shl    $0x7,%ecx
add    %ecx,%eax
add    $0x2,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @TneGvcMobile() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i16
%4 = call i32 @RegWriteA(i32 672, i8 zeroext 0)
%5 = call i32 @RegWriteA(i32 673, i8 zeroext 0)
%6 = call i32 @RegWriteA(i32 674, i8 zeroext 0)
%7 = call i32 @RegWriteA(i32 675, i8 zeroext 0)
%8 = call i32 @RamWrite32A(i32 4336, i32 1065353216)
%9 = call i32 @RamWrite32A(i32 4337, i32 0)
%10 = call i32 @RamWrite32A(i32 4338, i32 0)
%11 = call i32 @RamWrite32A(i32 4339, i32 0)
%12 = call i32 @RamWrite32A(i32 4340, i32 0)
%13 = call i32 @RamWrite32A(i32 4341, i32 1065353216)
%14 = call i32 @RamWrite32A(i32 4342, i32 0)
%15 = call i32 @RamWrite32A(i32 4343, i32 0)
%16 = call i32 @RamWrite32A(i32 4344, i32 0)
%17 = call i32 @RamWrite32A(i32 4345, i32 0)
%18 = call i32 @RamWrite32A(i32 4592, i32 1065353216)
%19 = call i32 @RamWrite32A(i32 4593, i32 0)
%20 = call i32 @RamWrite32A(i32 4594, i32 0)
%21 = call i32 @RamWrite32A(i32 4595, i32 0)
%22 = call i32 @RamWrite32A(i32 4596, i32 0)
%23 = call i32 @RamWrite32A(i32 4597, i32 1065353216)
%24 = call i32 @RamWrite32A(i32 4598, i32 0)
%25 = call i32 @RamWrite32A(i32 4599, i32 0)
%26 = call i32 @RamWrite32A(i32 4600, i32 0)
%27 = call i32 @RamWrite32A(i32 4601, i32 0)
%28 = call i32 @RegWriteA(i32 404, i8 zeroext 0)
%29 = call i32 @RegWriteA(i32 405, i8 zeroext 0)
%30 = call i32 @ClrGyr(i32 4096, i32 2)
%31 = call i64 @GenMesMobile(i32 5194, i32 0)
%32 = trunc i64 %31 to i16
store i16 %32, i16* %2
%33 = load i16, i16* %2
%34 = zext i16 %33 to i32
%35 = ashr i32 %34, 8
%36 = trunc i32 %35 to i8
%37 = call i32 @RegWriteA(i32 672, i8 zeroext %36)
%38 = load i16, i16* %2
%39 = trunc i16 %38 to i8
%40 = call i32 @RegWriteA(i32 673, i8 zeroext %39)
%41 = call i32 @RegWriteA(i32 404, i8 zeroext 0)
%42 = call i32 @RegWriteA(i32 405, i8 zeroext 0)
%43 = call i32 @ClrGyr(i32 4096, i32 2)
%44 = call i64 @GenMesMobile(i32 5322, i32 0)
%45 = trunc i64 %44 to i16
store i16 %45, i16* %3
%46 = load i16, i16* %3
%47 = zext i16 %46 to i32
%48 = ashr i32 %47, 8
%49 = trunc i32 %48 to i8
%50 = call i32 @RegWriteA(i32 674, i8 zeroext %49)
%51 = load i16, i16* %3
%52 = trunc i16 %51 to i8
%53 = call i32 @RegWriteA(i32 675, i8 zeroext %52)
store i32 2, i32* %1
%54 = load i16, i16* %2
%55 = sext i16 %54 to i32
%56 = icmp slt i32 %55, -655
br i1 %56, label %61, label %57
57: ; preds = %0
%58 = load i16, i16* %2
%59 = sext i16 %58 to i32
%60 = icmp sgt i32 %59, 655
br i1 %60, label %61, label %64
61: ; preds = %57, %0
%62 = load i32, i32* %1
%63 = or i32 %62, 66
store i32 %63, i32* %1
br label %64
64: ; preds = %61, %57
%65 = load i16, i16* %3
%66 = sext i16 %65 to i32
%67 = icmp slt i32 %66, -655
br i1 %67, label %72, label %68
68: ; preds = %64
%69 = load i16, i16* %3
%70 = sext i16 %69 to i32
%71 = icmp sgt i32 %70, 655
br i1 %71, label %72, label %75
72: ; preds = %68, %64
%73 = load i32, i32* %1
%74 = or i32 %73, 130
store i32 %74, i32* %1
br label %75
75: ; preds = %72, %68
%76 = load i32, i32* %1
ret i32 %76
}

LLVM IR (-O2):
define i32 @TneGvcMobile() {
%1 = tail call i32 @RegWriteA(i32 672, i8 zeroext 0)
%2 = tail call i32 @RegWriteA(i32 673, i8 zeroext 0)
%3 = tail call i32 @RegWriteA(i32 674, i8 zeroext 0)
%4 = tail call i32 @RegWriteA(i32 675, i8 zeroext 0)
%5 = tail call i32 @RamWrite32A(i32 4336, i32 1065353216)
%6 = tail call i32 @RamWrite32A(i32 4337, i32 0)
%7 = tail call i32 @RamWrite32A(i32 4338, i32 0)
%8 = tail call i32 @RamWrite32A(i32 4339, i32 0)
%9 = tail call i32 @RamWrite32A(i32 4340, i32 0)
%10 = tail call i32 @RamWrite32A(i32 4341, i32 1065353216)
%11 = tail call i32 @RamWrite32A(i32 4342, i32 0)
%12 = tail call i32 @RamWrite32A(i32 4343, i32 0)
%13 = tail call i32 @RamWrite32A(i32 4344, i32 0)
%14 = tail call i32 @RamWrite32A(i32 4345, i32 0)
%15 = tail call i32 @RamWrite32A(i32 4592, i32 1065353216)
%16 = tail call i32 @RamWrite32A(i32 4593, i32 0)
%17 = tail call i32 @RamWrite32A(i32 4594, i32 0)
%18 = tail call i32 @RamWrite32A(i32 4595, i32 0)
%19 = tail call i32 @RamWrite32A(i32 4596, i32 0)
%20 = tail call i32 @RamWrite32A(i32 4597, i32 1065353216)
%21 = tail call i32 @RamWrite32A(i32 4598, i32 0)
%22 = tail call i32 @RamWrite32A(i32 4599, i32 0)
%23 = tail call i32 @RamWrite32A(i32 4600, i32 0)
%24 = tail call i32 @RamWrite32A(i32 4601, i32 0)
%25 = tail call i32 @RegWriteA(i32 404, i8 zeroext 0)
%26 = tail call i32 @RegWriteA(i32 405, i8 zeroext 0)
%27 = tail call i32 @ClrGyr(i32 4096, i32 2)
%28 = tail call i64 @GenMesMobile(i32 5194, i32 0)
%29 = trunc i64 %28 to i32
%30 = lshr i64 %28, 8
%31 = trunc i64 %30 to i8
%32 = tail call i32 @RegWriteA(i32 672, i8 zeroext %31)
%33 = trunc i64 %28 to i8
%34 = tail call i32 @RegWriteA(i32 673, i8 zeroext %33)
%35 = tail call i32 @RegWriteA(i32 404, i8 zeroext 0)
%36 = tail call i32 @RegWriteA(i32 405, i8 zeroext 0)
%37 = tail call i32 @ClrGyr(i32 4096, i32 2)
%38 = tail call i64 @GenMesMobile(i32 5322, i32 0)
%39 = trunc i64 %38 to i32
%40 = lshr i64 %38, 8
%41 = trunc i64 %40 to i8
%42 = tail call i32 @RegWriteA(i32 674, i8 zeroext %41)
%43 = trunc i64 %38 to i8
%44 = tail call i32 @RegWriteA(i32 675, i8 zeroext %43)
%45 = shl i32 %29, 16
%46 = add i32 %45, -42926081
%47 = icmp ult i32 %46, -85852161
%48 = select i1 %47, i32 66, i32 2
%49 = shl i32 %39, 16
%50 = add i32 %49, -42926081
%51 = icmp ult i32 %50, -85852161
%52 = or i32 %48, 130
%53 = select i1 %51, i32 %52, i32 %48
ret i32 %53
}