#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*/ 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;
  ;
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000024))) = ui32Length;
  for (ui32Count = 0; ui32Count < (ui32Length / 4); ui32Count += 2) {
    while ((0x00000002 &
            ((*((volatile unsigned long *)(ui32Base + 0x00000020))))) == 0) {
    }
    DESDataWriteNonBlocking(ui32Base, pui32Src + ui32Count);
    while ((0x00000001 &
            ((*((volatile unsigned long *)(ui32Base + 0x00000020))))) == 0) {
    }
    DESDataReadNonBlocking(ui32Base, pui32Dest + ui32Count);
  }
  return (1);
}


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)
movslq -0x1c(%rbp),%rcx
mov    -0x4(%rbp),%eax
add    $0x24,%eax
cltq
mov    %rcx,(%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    11e7 <DESDataProcess+0xc7>
jmp    116f <DESDataProcess+0x4f>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
cltq
mov    (%rax),%rax
and    $0x2,%rax
cmp    $0x0,%rax
jne    118d <DESDataProcess+0x6d>
jmp    116f <DESDataProcess+0x4f>
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),%rax
and    $0x1,%rax
cmp    $0x0,%rax
jne    11c2 <DESDataProcess+0xa2>
jmp    11a4 <DESDataProcess+0x84>
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
movslq -0x20(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
call   1040 <DESDataReadNonBlocking@plt>
mov    -0x20(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x20(%rbp)
jmp    114c <DESDataProcess+0x2c>
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
movslq %ecx,%rax
movslq %edi,%rbx
mov    %rax,0x24(%rbx)
cmp    $0x4,%eax
jl     118f <DESDataProcess+0x6f>
mov    %ecx,%r12d
mov    %rdx,%r14
mov    %rsi,%r15
mov    %edi,%r13d
shr    $0x2,%r12d
xor    %ebp,%ebp
nopl   0x0(%rax)
testq  $0x2,0x20(%rbx)
je     1150 <DESDataProcess+0x30>
lea    (%r15,%rbp,4),%rsi
mov    %r13d,%edi
call   1030 <DESDataWriteNonBlocking@plt>
cs nopw 0x0(%rax,%rax,1)
testq  $0x1,0x20(%rbx)
je     1170 <DESDataProcess+0x50>
lea    (%r14,%rbp,4),%rsi
mov    %r13d,%edi
call   1040 <DESDataReadNonBlocking@plt>
add    $0x2,%rbp
cmp    %r12,%rbp
jb     1150 <DESDataProcess+0x30>
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* %8
%11 = sext i32 %10 to i64
%12 = load i32, i32* %5
%13 = add nsw i32 %12, 36
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i64*
store volatile i64 %11, i64* %15
store i32 0, i32* %9
br label %16
16: ; preds = %54, %4
%17 = load i32, i32* %9
%18 = load i32, i32* %8
%19 = sdiv i32 %18, 4
%20 = icmp slt i32 %17, %19
br i1 %20, label %21, label %57
21: ; preds = %16
br label %22
22: ; preds = %30, %21
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 32
%25 = sext i32 %24 to i64
%26 = inttoptr i64 %25 to i64*
%27 = load volatile i64, i64* %26
%28 = and i64 2, %27
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %31
30: ; preds = %22
br label %22
31: ; preds = %22
%32 = load i32, i32* %5
%33 = load i32*, i32** %6
%34 = load i32, i32* %9
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i32, i32* %33, i64 %35
%37 = call i32 @DESDataWriteNonBlocking(i32 %32, i32* %36)
br label %38
38: ; preds = %46, %31
%39 = load i32, i32* %5
%40 = add nsw i32 %39, 32
%41 = sext i32 %40 to i64
%42 = inttoptr i64 %41 to i64*
%43 = load volatile i64, i64* %42
%44 = and i64 1, %43
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %47
46: ; preds = %38
br label %38
47: ; preds = %38
%48 = load i32, i32* %5
%49 = load i32*, i32** %7
%50 = load i32, i32* %9
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i32, i32* %49, i64 %51
%53 = call i32 @DESDataReadNonBlocking(i32 %48, i32* %52)
br label %54
54: ; preds = %47
%55 = load i32, i32* %9
%56 = add nsw i32 %55, 2
store i32 %56, i32* %9
br label %16
57: ; preds = %16
ret i32 1
}

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