#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*/ GyOutSignal();
int /*<<< orphan*/ RegReadA(int, unsigned char *);
int /*<<< orphan*/ RegWriteA(int, int);
unsigned short GetGyrTemp(void) {
  unsigned char UcGrdat0H;
  unsigned char UcGrdat0L;
  unsigned short UsTempOut;
  RegWriteA(0x0280, 0x01);
  RegWriteA(0x0283, 0x41);
  RegWriteA(0x0282, 0x02);
  RegReadA(0x0290, &UcGrdat0H);
  RegReadA(0x0291, &UcGrdat0L);
  UsTempOut = ((unsigned short)UcGrdat0H << 8) | ((unsigned short)UcGrdat0L);
  GyOutSignal();
  return (UsTempOut);
}


x86 assembly (clang, -O0):
<GetGyrTemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x280,%edi
mov    $0x1,%esi
call   1040 <RegWriteA@plt>
mov    $0x283,%edi
mov    $0x41,%esi
call   1040 <RegWriteA@plt>
mov    $0x282,%edi
mov    $0x2,%esi
call   1040 <RegWriteA@plt>
mov    $0x290,%edi
lea    -0x1(%rbp),%rsi
call   1030 <RegReadA@plt>
mov    $0x291,%edi
lea    -0x2(%rbp),%rsi
call   1030 <RegReadA@plt>
movzbl -0x1(%rbp),%eax
movzwl %ax,%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
movzwl %cx,%ecx
or     %ecx,%eax
mov    %ax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <GyOutSignal@plt>
movzwl -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetGyrTemp>:
push   %rbx
sub    $0x10,%rsp
mov    $0x280,%edi
mov    $0x1,%esi
call   1040 <RegWriteA@plt>
mov    $0x283,%edi
mov    $0x41,%esi
call   1040 <RegWriteA@plt>
mov    $0x282,%edi
mov    $0x2,%esi
call   1040 <RegWriteA@plt>
lea    0xf(%rsp),%rsi
mov    $0x290,%edi
call   1030 <RegReadA@plt>
lea    0xe(%rsp),%rsi
mov    $0x291,%edi
call   1030 <RegReadA@plt>
movzbl 0xf(%rsp),%eax
shl    $0x8,%eax
movzbl 0xe(%rsp),%ebx
or     %eax,%ebx
xor    %eax,%eax
call   1050 <GyOutSignal@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @GetGyrTemp() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i16
%4 = call i32 @RegWriteA(i32 640, i32 1)
%5 = call i32 @RegWriteA(i32 643, i32 65)
%6 = call i32 @RegWriteA(i32 642, i32 2)
%7 = call i32 @RegReadA(i32 656, i8* %1)
%8 = call i32 @RegReadA(i32 657, i8* %2)
%9 = load i8, i8* %1
%10 = zext i8 %9 to i16
%11 = zext i16 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %2
%14 = zext i8 %13 to i16
%15 = zext i16 %14 to i32
%16 = or i32 %12, %15
%17 = trunc i32 %16 to i16
store i16 %17, i16* %3
%18 = call i32 (...) @GyOutSignal()
%19 = load i16, i16* %3
ret i16 %19
}

LLVM IR (-O2):
define zeroext i16 @GetGyrTemp() {
%1 = alloca i8
%2 = alloca i8
%3 = tail call i32 @RegWriteA(i32 640, i32 1)
%4 = tail call i32 @RegWriteA(i32 643, i32 65)
%5 = tail call i32 @RegWriteA(i32 642, i32 2)
%6 = call i32 @RegReadA(i32 656, i8* %1)
%7 = call i32 @RegReadA(i32 657, i8* %2)
%8 = load i8, i8* %1
%9 = zext i8 %8 to i16
%10 = shl nuw i16 %9, 8
%11 = load i8, i8* %2
%12 = zext i8 %11 to i16
%13 = or i16 %10, %12
%14 = call i32 (...) @GyOutSignal()
ret i16 %13
}