#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);
void SHAMD5Reset(uint32_t ui32Base) {
  ASSERT(ui32Base == 0x44034000);
  (*((volatile uint32_t *)(ui32Base + 0x00000110))) |= 0x00000002;
  while (((*((volatile uint32_t *)(ui32Base + 0x00000114))) & 0x00000001) ==
         0) {
  }
  (*((volatile uint32_t *)(ui32Base + 0x00000110))) =
      (((*((volatile uint32_t *)(ui32Base + 0x00000110))) & ~0x00000030) |
       0x00000000);
}


x86 assembly (clang, -O0):
<SHAMD5Reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x44034000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x110,%eax
cltq
mov    (%rax),%ecx
or     $0x2,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x114,%eax
cltq
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    115d <SHAMD5Reset+0x4d>
jmp    1140 <SHAMD5Reset+0x30>
mov    -0x4(%rbp),%eax
add    $0x110,%eax
cltq
mov    (%rax),%ecx
and    $0xffffffcf,%ecx
or     $0x0,%ecx
mov    -0x4(%rbp),%eax
add    $0x110,%eax
cltq
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAMD5Reset>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x44034000,%ebx
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
orl    $0x2,0x110(%rax)
xchg   %ax,%ax
testl  $0x1,0x114(%rax)
je     1130 <SHAMD5Reset+0x20>
andl   $0xffffffcf,0x110(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @SHAMD5Reset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1141063680
%5 = zext i1 %4 to i32
%6 = call i32 @ASSERT(i32 %5)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 272
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = or i32 %11, 2
store volatile i32 %12, i32* %10
br label %13
13: ; preds = %21, %1
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 276
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
%18 = load volatile i32, i32* %17
%19 = and i32 %18, 1
%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* %2
%24 = add nsw i32 %23, 272
%25 = sext i32 %24 to i64
%26 = inttoptr i64 %25 to i32*
%27 = load volatile i32, i32* %26
%28 = and i32 %27, -49
%29 = or i32 %28, 0
%30 = load i32, i32* %2
%31 = add nsw i32 %30, 272
%32 = sext i32 %31 to i64
%33 = inttoptr i64 %32 to i32*
store volatile i32 %29, i32* %33
ret void
}

LLVM IR (-O2):
define void @SHAMD5Reset(i32 %0) {
%2 = icmp eq i32 %0, 1141063680
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
%5 = add nsw i32 %0, 272
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = or i32 %8, 2
store volatile i32 %9, i32* %7
%10 = add nsw i32 %0, 276
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
br label %13
13: ; preds = %13, %1
%14 = load volatile i32, i32* %12
%15 = and i32 %14, 1
%16 = icmp eq i32 %15, 0
br i1 %16, label %13, label %17
17: ; preds = %13
%18 = load volatile i32, i32* %7
%19 = and i32 %18, -49
store volatile i32 %19, i32* %7
ret void
}