#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*/ ASSERT(int);
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) {
  ASSERT(ui32Base == 0x44034000);
  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)
cmpl   $0x44034000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x118,%eax
cltq
mov    (%rax),%eax
and    $0x8,%eax
cmp    $0x0,%eax
jne    1187 <SHAMD5HMACProcess+0x47>
jmp    116a <SHAMD5HMACProcess+0x2a>
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    11be <SHAMD5HMACProcess+0x7e>
jmp    11a1 <SHAMD5HMACProcess+0x61>
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1060 <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
xor    %edi,%edi
cmp    $0x44034000,%ebp
sete   %dil
call   1050 <ASSERT@plt>
movslq %ebp,%rbx
nopw   0x0(%rax,%rax,1)
testl  $0x8,0x118(%rbx)
je     1170 <SHAMD5HMACProcess+0x30>
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     11a0 <SHAMD5HMACProcess+0x60>
mov    %ebp,%edi
mov    %r14,%rsi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <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
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 1141063680
%11 = zext i1 %10 to i32
%12 = call i32 @ASSERT(i32 %11)
br label %13
13: ; preds = %21, %4
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 280
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
%18 = load volatile i32, i32* %17
%19 = and i32 %18, 8
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %13
br label %13
22: ; preds = %13
%23 = load i32, i32* %5
%24 = load i32, i32* %7
%25 = call i32 @SHAMD5HashLengthSet(i32 %23, i32 %24)
%26 = load i32, i32* %5
%27 = load i32*, i32** %6
%28 = load i32, i32* %7
%29 = call i32 @_SHAMD5DataWriteMultiple(i32 %26, i32* %27, i32 %28)
br label %30
30: ; preds = %38, %22
%31 = load i32, i32* %5
%32 = add nsw i32 %31, 280
%33 = sext i32 %32 to i64
%34 = inttoptr i64 %33 to i32*
%35 = load volatile i32, i32* %34
%36 = and i32 %35, 1
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %39
38: ; preds = %30
br label %30
39: ; preds = %30
%40 = load i32, i32* %5
%41 = load i32*, i32** %8
%42 = call i32 @SHAMD5ResultRead(i32 %40, i32* %41)
ret void
}

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