#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*/ DESDataReadNonBlocking(int, int *);
int /*<<< orphan*/ DESDataWriteNonBlocking(int, int *);
bool DESDataProcess(uint32_t ui32Base, uint32_t *pui32Src, uint32_t *pui32Dest,
                    uint32_t ui32Length) {
  uint32_t ui32Count;
  ASSERT(ui32Base == 0x44038000);
  ASSERT((ui32Length % 8) == 0);
  (*((volatile uint32_t *)(ui32Base + 0x00000024))) = ui32Length;
  for (ui32Count = 0; ui32Count < (ui32Length / 4); ui32Count += 2) {
    while ((0x00000002 & ((*((volatile uint32_t *)(ui32Base + 0x00000020))))) ==
           0) {
    }
    DESDataWriteNonBlocking(ui32Base, pui32Src + ui32Count);
    while ((0x00000001 & ((*((volatile uint32_t *)(ui32Base + 0x00000020))))) ==
           0) {
    }
    DESDataReadNonBlocking(ui32Base, pui32Dest + ui32Count);
  }
  return (true);
}


x86 assembly (clang, -O0):
<DESDataProcess>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0x44038000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <ASSERT@plt>
mov    -0x1c(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <ASSERT@plt>
mov    -0x1c(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x24,%eax
cltq
mov    %ecx,(%rax)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
cmp    %ecx,%eax
jge    121e <DESDataProcess+0xee>
jmp    11ac <DESDataProcess+0x7c>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
cltq
mov    (%rax),%eax
and    $0x2,%eax
cmp    $0x0,%eax
jne    11c7 <DESDataProcess+0x97>
jmp    11ac <DESDataProcess+0x7c>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
movslq -0x20(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
call   1030 <DESDataWriteNonBlocking@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
cltq
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    11f9 <DESDataProcess+0xc9>
jmp    11de <DESDataProcess+0xae>
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
movslq -0x20(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
call   1050 <DESDataReadNonBlocking@plt>
mov    -0x20(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x20(%rbp)
jmp    1189 <DESDataProcess+0x59>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DESDataProcess>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %ecx,%r12d
mov    %rdx,%r14
mov    %rsi,%r15
mov    %edi,%r13d
xor    %edi,%edi
cmp    $0x44038000,%r13d
sete   %dil
call   1040 <ASSERT@plt>
xor    %edi,%edi
test   $0x7,%r12b
sete   %dil
call   1040 <ASSERT@plt>
movslq %r13d,%rbx
mov    %r12d,0x24(%rbx)
cmp    $0x4,%r12d
jl     11be <DESDataProcess+0x8e>
shr    $0x2,%r12d
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
testl  $0x2,0x20(%rbx)
je     1180 <DESDataProcess+0x50>
lea    (%r15,%rbp,4),%rsi
mov    %r13d,%edi
call   1030 <DESDataWriteNonBlocking@plt>
cs nopw 0x0(%rax,%rax,1)
nop
testl  $0x1,0x20(%rbx)
je     11a0 <DESDataProcess+0x70>
lea    (%r14,%rbp,4),%rsi
mov    %r13d,%edi
call   1050 <DESDataReadNonBlocking@plt>
add    $0x2,%rbp
cmp    %r12,%rbp
jb     1180 <DESDataProcess+0x50>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @DESDataProcess(i32 %0, i32* %1, i32* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, 1141080064
%12 = zext i1 %11 to i32
%13 = call i32 @ASSERT(i32 %12)
%14 = load i32, i32* %8
%15 = srem i32 %14, 8
%16 = icmp eq i32 %15, 0
%17 = zext i1 %16 to i32
%18 = call i32 @ASSERT(i32 %17)
%19 = load i32, i32* %8
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 36
%22 = sext i32 %21 to i64
%23 = inttoptr i64 %22 to i32*
store volatile i32 %19, i32* %23
store i32 0, i32* %9
br label %24
24: ; preds = %62, %4
%25 = load i32, i32* %9
%26 = load i32, i32* %8
%27 = sdiv i32 %26, 4
%28 = icmp slt i32 %25, %27
br i1 %28, label %29, label %65
29: ; preds = %24
br label %30
30: ; preds = %38, %29
%31 = load i32, i32* %5
%32 = add nsw i32 %31, 32
%33 = sext i32 %32 to i64
%34 = inttoptr i64 %33 to i32*
%35 = load volatile i32, i32* %34
%36 = and i32 2, %35
%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** %6
%42 = load i32, i32* %9
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i32, i32* %41, i64 %43
%45 = call i32 @DESDataWriteNonBlocking(i32 %40, i32* %44)
br label %46
46: ; preds = %54, %39
%47 = load i32, i32* %5
%48 = add nsw i32 %47, 32
%49 = sext i32 %48 to i64
%50 = inttoptr i64 %49 to i32*
%51 = load volatile i32, i32* %50
%52 = and i32 1, %51
%53 = icmp eq i32 %52, 0
br i1 %53, label %54, label %55
54: ; preds = %46
br label %46
55: ; preds = %46
%56 = load i32, i32* %5
%57 = load i32*, i32** %7
%58 = load i32, i32* %9
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds i32, i32* %57, i64 %59
%61 = call i32 @DESDataReadNonBlocking(i32 %56, i32* %60)
br label %62
62: ; preds = %55
%63 = load i32, i32* %9
%64 = add nsw i32 %63, 2
store i32 %64, i32* %9
br label %24
65: ; preds = %24
ret i32 1
}

LLVM IR (-O2):
define i32 @DESDataProcess(i32 %0, i32* %1, i32* %2, i32 %3) {
%5 = icmp eq i32 %0, 1141080064
%6 = zext i1 %5 to i32
%7 = tail call i32 @ASSERT(i32 %6)
%8 = and i32 %3, 7
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
%11 = tail call i32 @ASSERT(i32 %10)
%12 = add nsw i32 %0, 36
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
store volatile i32 %3, i32* %14
%15 = icmp sgt i32 %3, 3
br i1 %15, label %16, label %40
16: ; preds = %4
%17 = lshr i32 %3, 2
%18 = add nsw i32 %0, 32
%19 = sext i32 %18 to i64
%20 = inttoptr i64 %19 to i32*
%21 = zext i32 %17 to i64
br label %22
22: ; preds = %16, %35
%23 = phi i64 [ 0, %16 ], [ %38, %35 ]
br label %24
24: ; preds = %22, %24
%25 = load volatile i32, i32* %20
%26 = and i32 %25, 2
%27 = icmp eq i32 %26, 0
br i1 %27, label %24, label %28
28: ; preds = %24
%29 = getelementptr inbounds i32, i32* %1, i64 %23
%30 = tail call i32 @DESDataWriteNonBlocking(i32 %0, i32* %29)
br label %31
31: ; preds = %31, %28
%32 = load volatile i32, i32* %20
%33 = and i32 %32, 1
%34 = icmp eq i32 %33, 0
br i1 %34, label %31, label %35
35: ; preds = %31
%36 = getelementptr inbounds i32, i32* %2, i64 %23
%37 = tail call i32 @DESDataReadNonBlocking(i32 %0, i32* %36)
%38 = add nuw nsw i64 %23, 2
%39 = icmp ult i64 %38, %21
br i1 %39, label %22, label %40
40: ; preds = %35, %4
ret i32 1
}