#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 */
unsigned short ADSGetByteB();
int /*<<< orphan*/ Confige_1115_B(unsigned int);
int /*<<< orphan*/ Point_reg_B();
int /*<<< orphan*/ Send1byteB(int);
int /*<<< orphan*/ startB();
int /*<<< orphan*/ stopB();
unsigned int Read_1115_B(unsigned int channel) {
  unsigned short int Result = 0;
  Confige_1115_B(channel);
  Point_reg_B();
  startB();
  Send1byteB(0x91);
  Result |= ADSGetByteB() << 8;
  Result |= ADSGetByteB();
  stopB();
  return Result;
}


x86 assembly (clang, -O0):
<Read_1115_B>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movw   $0x0,-0x6(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <Confige_1115_B@plt>
mov    $0x0,%al
call   1040 <Point_reg_B@plt>
mov    $0x0,%al
call   1060 <startB@plt>
mov    $0x91,%edi
call   1030 <Send1byteB@plt>
mov    $0x0,%al
call   1080 <ADSGetByteB@plt>
movzwl %ax,%ecx
shl    $0x8,%ecx
movzwl -0x6(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x6(%rbp)
mov    $0x0,%al
call   1080 <ADSGetByteB@plt>
movzwl %ax,%ecx
movzwl -0x6(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x6(%rbp)
mov    $0x0,%al
call   1070 <stopB@plt>
movzwl -0x6(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Read_1115_B>:
push   %rbp
push   %rbx
push   %rax
call   1050 <Confige_1115_B@plt>
xor    %eax,%eax
call   1040 <Point_reg_B@plt>
xor    %eax,%eax
call   1060 <startB@plt>
mov    $0x91,%edi
call   1030 <Send1byteB@plt>
xor    %eax,%eax
call   1080 <ADSGetByteB@plt>
mov    %eax,%ebx
shl    $0x8,%ebx
xor    %eax,%eax
call   1080 <ADSGetByteB@plt>
mov    %eax,%ebp
or     %ebx,%ebp
xor    %eax,%eax
call   1070 <stopB@plt>
movzwl %bp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @Read_1115_B(i32 %0) {
%2 = alloca i32
%3 = alloca i16
store i32 %0, i32* %2
store i16 0, i16* %3
%4 = load i32, i32* %2
%5 = call i32 @Confige_1115_B(i32 %4)
%6 = call i32 (...) @Point_reg_B()
%7 = call i32 (...) @startB()
%8 = call i32 @Send1byteB(i32 145)
%9 = call zeroext i16 (...) @ADSGetByteB()
%10 = zext i16 %9 to i32
%11 = shl i32 %10, 8
%12 = load i16, i16* %3
%13 = zext i16 %12 to i32
%14 = or i32 %13, %11
%15 = trunc i32 %14 to i16
store i16 %15, i16* %3
%16 = call zeroext i16 (...) @ADSGetByteB()
%17 = zext i16 %16 to i32
%18 = load i16, i16* %3
%19 = zext i16 %18 to i32
%20 = or i32 %19, %17
%21 = trunc i32 %20 to i16
store i16 %21, i16* %3
%22 = call i32 (...) @stopB()
%23 = load i16, i16* %3
%24 = zext i16 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @Read_1115_B(i32 %0) {
%2 = tail call i32 @Confige_1115_B(i32 %0)
%3 = tail call i32 (...) @Point_reg_B()
%4 = tail call i32 (...) @startB()
%5 = tail call i32 @Send1byteB(i32 145)
%6 = tail call zeroext i16 (...) @ADSGetByteB()
%7 = shl i16 %6, 8
%8 = tail call zeroext i16 (...) @ADSGetByteB()
%9 = or i16 %7, %8
%10 = tail call i32 (...) @stopB()
%11 = zext i16 %9 to i32
ret i32 %11
}