#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 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)
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    11df <DESDataProcess+0xbf>
jmp    116d <DESDataProcess+0x4d>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
cltq
mov    (%rax),%eax
and    $0x2,%eax
cmp    $0x0,%eax
jne    1188 <DESDataProcess+0x68>
jmp    116d <DESDataProcess+0x4d>
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    11ba <DESDataProcess+0x9a>
jmp    119f <DESDataProcess+0x7f>
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    114a <DESDataProcess+0x2a>
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 %edi,%rbx
mov    %ecx,0x24(%rbx)
cmp    $0x4,%ecx
jl     118e <DESDataProcess+0x6e>
mov    %ecx,%r12d
mov    %rdx,%r14
mov    %rsi,%r15
mov    %edi,%r13d
shr    $0x2,%r12d
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
testl  $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)
nop
testl  $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 = load i32, i32* %5
%12 = add nsw i32 %11, 36
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
store volatile i32 %10, i32* %14
store i32 0, i32* %9
br label %15
15: ; preds = %53, %4
%16 = load i32, i32* %9
%17 = load i32, i32* %8
%18 = sdiv i32 %17, 4
%19 = icmp slt i32 %16, %18
br i1 %19, label %20, label %56
20: ; preds = %15
br label %21
21: ; preds = %29, %20
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 32
%24 = sext i32 %23 to i64
%25 = inttoptr i64 %24 to i32*
%26 = load volatile i32, i32* %25
%27 = and i32 2, %26
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %21
br label %21
30: ; preds = %21
%31 = load i32, i32* %5
%32 = load i32*, i32** %6
%33 = load i32, i32* %9
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i32, i32* %32, i64 %34
%36 = call i32 @DESDataWriteNonBlocking(i32 %31, i32* %35)
br label %37
37: ; preds = %45, %30
%38 = load i32, i32* %5
%39 = add nsw i32 %38, 32
%40 = sext i32 %39 to i64
%41 = inttoptr i64 %40 to i32*
%42 = load volatile i32, i32* %41
%43 = and i32 1, %42
%44 = icmp eq i32 %43, 0
br i1 %44, label %45, label %46
45: ; preds = %37
br label %37
46: ; preds = %37
%47 = load i32, i32* %5
%48 = load i32*, i32** %7
%49 = load i32, i32* %9
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i32, i32* %48, i64 %50
%52 = call i32 @DESDataReadNonBlocking(i32 %47, i32* %51)
br label %53
53: ; preds = %46
%54 = load i32, i32* %9
%55 = add nsw i32 %54, 2
store i32 %55, i32* %9
br label %15
56: ; preds = %15
ret i32 1
}

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