#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 uint32_t;

/* Variables and functions */
int /*<<< orphan*/ SHAMD5HashLengthSet(int, int);
int /*<<< orphan*/ SHAMD5ResultRead(int, int *);
int /*<<< orphan*/ _SHAMD5DataWriteMultiple(int, int *, int);
void SHAMD5HMACProcess(uint32_t ui32Base, uint32_t *pui32DataSrc,
                       uint32_t ui32DataLength, uint32_t *pui32HashResult) {
  ;
  while (((*((volatile uint32_t *)(ui32Base + 0x00000118))) & 0x00000008) ==
         0) {
  }
  SHAMD5HashLengthSet(ui32Base, ui32DataLength);
  _SHAMD5DataWriteMultiple(ui32Base, pui32DataSrc, ui32DataLength);
  while (((*((volatile uint32_t *)(ui32Base + 0x00000118))) & 0x00000001) ==
         0) {
  }
  SHAMD5ResultRead(ui32Base, pui32HashResult);
}


x86 assembly (clang, -O0):
<SHAMD5HMACProcess>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
add    $0x118,%eax
cltq
mov    (%rax),%eax
and    $0x8,%eax
cmp    $0x0,%eax
jne    1163 <SHAMD5HMACProcess+0x33>
jmp    1146 <SHAMD5HMACProcess+0x16>
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <SHAMD5HashLengthSet@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <_SHAMD5DataWriteMultiple@plt>
mov    -0x4(%rbp),%eax
add    $0x118,%eax
cltq
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    119a <SHAMD5HMACProcess+0x6a>
jmp    117d <SHAMD5HMACProcess+0x4d>
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1050 <SHAMD5ResultRead@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAMD5HMACProcess>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rcx,%r14
mov    %edx,%r12d
mov    %rsi,%r15
mov    %edi,%ebp
movslq %edi,%rbx
cs nopw 0x0(%rax,%rax,1)
testl  $0x8,0x118(%rbx)
je     1150 <SHAMD5HMACProcess+0x20>
mov    %ebp,%edi
mov    %r12d,%esi
call   1040 <SHAMD5HashLengthSet@plt>
mov    %ebp,%edi
mov    %r15,%rsi
mov    %r12d,%edx
call   1030 <_SHAMD5DataWriteMultiple@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
testl  $0x1,0x118(%rbx)
je     1180 <SHAMD5HMACProcess+0x50>
mov    %ebp,%edi
mov    %r14,%rsi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <SHAMD5ResultRead@plt>

LLVM IR (-O0):
define void @SHAMD5HMACProcess(i32 %0, i32* %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32*
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32* %3, i32** %8
br label %9
9: ; preds = %17, %4
%10 = load i32, i32* %5
%11 = add nsw i32 %10, 280
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
%15 = and i32 %14, 8
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %9
br label %9
18: ; preds = %9
%19 = load i32, i32* %5
%20 = load i32, i32* %7
%21 = call i32 @SHAMD5HashLengthSet(i32 %19, i32 %20)
%22 = load i32, i32* %5
%23 = load i32*, i32** %6
%24 = load i32, i32* %7
%25 = call i32 @_SHAMD5DataWriteMultiple(i32 %22, i32* %23, i32 %24)
br label %26
26: ; preds = %34, %18
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 280
%29 = sext i32 %28 to i64
%30 = inttoptr i64 %29 to i32*
%31 = load volatile i32, i32* %30
%32 = and i32 %31, 1
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %35
34: ; preds = %26
br label %26
35: ; preds = %26
%36 = load i32, i32* %5
%37 = load i32*, i32** %8
%38 = call i32 @SHAMD5ResultRead(i32 %36, i32* %37)
ret void
}

LLVM IR (-O2):
define void @SHAMD5HMACProcess(i32 %0, i32* %1, i32 %2, i32* %3) {
%5 = add nsw i32 %0, 280
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
br label %8
8: ; preds = %8, %4
%9 = load volatile i32, i32* %7
%10 = and i32 %9, 8
%11 = icmp eq i32 %10, 0
br i1 %11, label %8, label %12
12: ; preds = %8
%13 = tail call i32 @SHAMD5HashLengthSet(i32 %0, i32 %2)
%14 = tail call i32 @_SHAMD5DataWriteMultiple(i32 %0, i32* %1, i32 %2)
br label %15
15: ; preds = %15, %12
%16 = load volatile i32, i32* %7
%17 = and i32 %16, 1
%18 = icmp eq i32 %17, 0
br i1 %18, label %15, label %19
19: ; preds = %15
%20 = tail call i32 @SHAMD5ResultRead(i32 %0, i32* %3)
ret void
}