#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 */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ M_DRV_I2C_Read(int, int, int *, int);
int /*<<< orphan*/ M_PRINTF(char *, int, int);
int M_DRV_MC3610_ReadRegMap(unsigned char baRegMap[64]) {
  uint8_t _bIndex = 0;
  uint8_t _bRegData = 0;
  for (_bIndex = 0; _bIndex < 64; _bIndex++) {
    M_DRV_I2C_Read((((0x4C) << 1) | 0x01), _bIndex, &_bRegData, 1);
    M_PRINTF("REG[0x%02X] 0x%02X", _bIndex, _bRegData);
    if (0 != baRegMap)
      baRegMap[_bIndex] = _bRegData;
  }
  return ((0));
}


x86 assembly (clang, -O0):
<M_DRV_MC3610_ReadRegMap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x40,-0xc(%rbp)
jge    11a2 <M_DRV_MC3610_ReadRegMap+0x82>
mov    -0xc(%rbp),%esi
mov    $0x99,%edi
lea    -0x10(%rbp),%rdx
mov    $0x1,%ecx
call   1040 <M_DRV_I2C_Read@plt>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe92(%rip),%rdi
call   1030 <M_PRINTF@plt>
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     118f <M_DRV_MC3610_ReadRegMap+0x6f>
mov    -0x10(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1194 <M_DRV_MC3610_ReadRegMap+0x74>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1141 <M_DRV_MC3610_ReadRegMap+0x21>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M_DRV_MC3610_ReadRegMap>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
movl   $0x0,0x4(%rsp)
xor    %ebx,%ebx
lea    0x4(%rsp),%r15
lea    0xebf(%rip),%r12
jmp    115a <M_DRV_MC3610_ReadRegMap+0x3a>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rbx
cmp    $0x40,%rbx
je     118c <M_DRV_MC3610_ReadRegMap+0x6c>
mov    $0x99,%edi
mov    %ebx,%esi
mov    %r15,%rdx
mov    $0x1,%ecx
call   1040 <M_DRV_I2C_Read@plt>
mov    0x4(%rsp),%edx
mov    %r12,%rdi
mov    %ebx,%esi
call   1030 <M_PRINTF@plt>
test   %r14,%r14
je     1150 <M_DRV_MC3610_ReadRegMap+0x30>
movzbl 0x4(%rsp),%eax
mov    %al,(%r14,%rbx,1)
jmp    1150 <M_DRV_MC3610_ReadRegMap+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [19 x i8] c"REG[0x%02X] 0x%02X\00"
define i32 @M_DRV_MC3610_ReadRegMap(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %24, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 64
br i1 %7, label %8, label %27
8: ; preds = %5
%9 = load i32, i32* %3
%10 = call i32 @M_DRV_I2C_Read(i32 153, i32 %9, i32* %4, i32 1)
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @M_PRINTF(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
%14 = load i8*, i8** %2
%15 = icmp ne i8* null, %14
br i1 %15, label %16, label %23
16: ; preds = %8
%17 = load i32, i32* %4
%18 = trunc i32 %17 to i8
%19 = load i8*, i8** %2
%20 = load i32, i32* %3
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
store i8 %18, i8* %22
br label %23
23: ; preds = %16, %8
br label %24
24: ; preds = %23
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
br label %5
27: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"REG[0x%02X] 0x%02X\00"
define i32 @M_DRV_MC3610_ReadRegMap(i8* writeonly %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = icmp eq i8* %0, null
br label %5
5: ; preds = %1, %15
%6 = phi i64 [ 0, %1 ], [ %16, %15 ]
%7 = trunc i64 %6 to i32
%8 = call i32 @M_DRV_I2C_Read(i32 153, i32 %7, i32* %2, i32 1)
%9 = load i32, i32* %2
%10 = call i32 @M_PRINTF(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9)
br i1 %4, label %15, label %11
11: ; preds = %5
%12 = load i32, i32* %2
%13 = trunc i32 %12 to i8
%14 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %13, i8* %14
br label %15
15: ; preds = %5, %11
%16 = add nuw nsw i64 %6, 1
%17 = icmp eq i64 %16, 64
br i1 %17, label %18, label %5
18: ; preds = %15
ret i32 0
}