#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*/ M_DRV_I2C_Read(int, int, unsigned char *, int);
int /*<<< orphan*/ M_DRV_I2C_Write(int, int, unsigned char *, int);
int /*<<< orphan*/ _M_DRV_MC3610_Delay(int);
void _M_DRV_MC3610_ASC_ReadSensorData(unsigned char *pbData) {
  unsigned char _bRegData = 0x05;
  unsigned char _bCheckCount = 0x00;
  M_DRV_I2C_Write((((0x4C) << 1) | 0x00), 0x10, &_bRegData, 1);
  for (_bCheckCount = 0; _bCheckCount < 16; _bCheckCount++) {
    _M_DRV_MC3610_Delay(50);
    M_DRV_I2C_Read((((0x4C) << 1) | 0x01), 0x08, &_bRegData, 1);
    if (_bRegData & 0x08)
      break;
  }
  M_DRV_I2C_Read((((0x4C) << 1) | 0x01), 0x02, pbData, 6);
  _bRegData = 0x01;
  M_DRV_I2C_Write((((0x4C) << 1) | 0x00), 0x10, &_bRegData, 1);
}


x86 assembly (clang, -O0):
<_M_DRV_MC3610_ASC_ReadSensorData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x5,-0x9(%rbp)
movb   $0x0,-0xa(%rbp)
mov    $0x98,%edi
mov    $0x10,%esi
lea    -0x9(%rbp),%rdx
mov    $0x1,%ecx
call   1050 <M_DRV_I2C_Write@plt>
movb   $0x0,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
cmp    $0x10,%eax
jge    11b6 <_M_DRV_MC3610_ASC_ReadSensorData+0x86>
mov    $0x32,%edi
call   1030 <_M_DRV_MC3610_Delay@plt>
mov    $0x99,%edi
mov    $0x8,%esi
lea    -0x9(%rbp),%rdx
mov    $0x1,%ecx
call   1040 <M_DRV_I2C_Read@plt>
movzbl -0x9(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     11a4 <_M_DRV_MC3610_ASC_ReadSensorData+0x74>
jmp    11b6 <_M_DRV_MC3610_ASC_ReadSensorData+0x86>
jmp    11a9 <_M_DRV_MC3610_ASC_ReadSensorData+0x79>
mov    -0xa(%rbp),%al
add    $0x1,%al
mov    %al,-0xa(%rbp)
jmp    1160 <_M_DRV_MC3610_ASC_ReadSensorData+0x30>
mov    -0x8(%rbp),%rdx
mov    $0x99,%edi
mov    $0x2,%esi
mov    $0x6,%ecx
call   1040 <M_DRV_I2C_Read@plt>
movb   $0x1,-0x9(%rbp)
mov    $0x98,%edi
mov    $0x10,%esi
lea    -0x9(%rbp),%rdx
mov    $0x1,%ecx
call   1050 <M_DRV_I2C_Write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_M_DRV_MC3610_ASC_ReadSensorData>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%r14
movb   $0x5,0xf(%rsp)
lea    0xf(%rsp),%r15
mov    $0x98,%edi
mov    $0x10,%esi
mov    %r15,%rdx
mov    $0x1,%ecx
call   1050 <M_DRV_I2C_Write@plt>
mov    $0xf,%bl
nop
mov    $0x32,%edi
call   1030 <_M_DRV_MC3610_Delay@plt>
mov    $0x99,%edi
mov    $0x8,%esi
mov    %r15,%rdx
mov    $0x1,%ecx
call   1040 <M_DRV_I2C_Read@plt>
sub    $0x1,%bl
setb   %al
testb  $0x8,0xf(%rsp)
jne    1192 <_M_DRV_MC3610_ASC_ReadSensorData+0x62>
test   %al,%al
je     1160 <_M_DRV_MC3610_ASC_ReadSensorData+0x30>
mov    $0x99,%edi
mov    $0x2,%esi
mov    %r14,%rdx
mov    $0x6,%ecx
call   1040 <M_DRV_I2C_Read@plt>
movb   $0x1,0xf(%rsp)
lea    0xf(%rsp),%rdx
mov    $0x98,%edi
mov    $0x10,%esi
mov    $0x1,%ecx
call   1050 <M_DRV_I2C_Write@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @_M_DRV_MC3610_ASC_ReadSensorData(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
store i8 5, i8* %3
store i8 0, i8* %4
%5 = call i32 @M_DRV_I2C_Write(i32 152, i32 16, i8* %3, i32 1)
store i8 0, i8* %4
br label %6
6: ; preds = %19, %1
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = icmp slt i32 %8, 16
br i1 %9, label %10, label %22
10: ; preds = %6
%11 = call i32 @_M_DRV_MC3610_Delay(i32 50)
%12 = call i32 @M_DRV_I2C_Read(i32 153, i32 8, i8* %3, i32 1)
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = and i32 %14, 8
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %10
br label %22
18: ; preds = %10
br label %19
19: ; preds = %18
%20 = load i8, i8* %4
%21 = add i8 %20, 1
store i8 %21, i8* %4
br label %6
22: ; preds = %17, %6
%23 = load i8*, i8** %2
%24 = call i32 @M_DRV_I2C_Read(i32 153, i32 2, i8* %23, i32 6)
store i8 1, i8* %3
%25 = call i32 @M_DRV_I2C_Write(i32 152, i32 16, i8* %3, i32 1)
ret void
}

LLVM IR (-O2):
define void @_M_DRV_MC3610_ASC_ReadSensorData(i8* %0) {
%2 = alloca i8
store i8 5, i8* %2
%3 = call i32 @M_DRV_I2C_Write(i32 152, i32 16, i8* %2, i32 1)
br label %4
4: ; preds = %4, %1
%5 = phi i8 [ 0, %1 ], [ %11, %4 ]
%6 = call i32 @_M_DRV_MC3610_Delay(i32 50)
%7 = call i32 @M_DRV_I2C_Read(i32 153, i32 8, i8* %2, i32 1)
%8 = load i8, i8* %2
%9 = and i8 %8, 8
%10 = icmp ne i8 %9, 0
%11 = add nuw nsw i8 %5, 1
%12 = icmp eq i8 %11, 16
%13 = select i1 %10, i1 true, i1 %12
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = call i32 @M_DRV_I2C_Read(i32 153, i32 2, i8* %0, i32 6)
store i8 1, i8* %2
%16 = call i32 @M_DRV_I2C_Write(i32 152, i32 16, i8* %2, i32 1)
ret void
}