#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 */
void AESDataRead(uint32_t ui32Base, uint32_t *pui32Dest) {
  ;
  while ((0x00000001 & ((*((volatile uint32_t *)(ui32Base + 0x00000050))))) ==
         0) {
  }
  pui32Dest[0] = (*((volatile uint32_t *)(ui32Base + 0x0000006C)));
  pui32Dest[1] = (*((volatile uint32_t *)(ui32Base + 0x00000068)));
  pui32Dest[2] = (*((volatile uint32_t *)(ui32Base + 0x00000064)));
  pui32Dest[3] = (*((volatile uint32_t *)(ui32Base + 0x00000060)));
}


x86 assembly (clang, -O0):
<AESDataRead>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%eax
cltq
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1126 <AESDataRead+0x26>
jmp    110b <AESDataRead+0xb>
mov    -0x4(%rbp),%eax
add    $0x6c,%eax
cltq
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x68,%eax
cltq
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x4(%rbp),%eax
add    $0x64,%eax
cltq
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x4(%rbp),%eax
add    $0x60,%eax
cltq
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AESDataRead>:
movslq %edi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
testl  $0x1,0x50(%rax)
je     1110 <AESDataRead+0x10>
mov    0x6c(%rax),%ecx
mov    %ecx,(%rsi)
mov    0x68(%rax),%ecx
mov    %ecx,0x4(%rsi)
mov    0x64(%rax),%ecx
mov    %ecx,0x8(%rsi)
mov    0x60(%rax),%eax
mov    %eax,0xc(%rsi)
ret

LLVM IR (-O0):
define void @AESDataRead(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
br label %5
5: ; preds = %13, %2
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 80
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
%11 = and i32 1, %10
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %5
br label %5
14: ; preds = %5
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 108
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
%19 = load volatile i32, i32* %18
%20 = load i32*, i32** %4
%21 = getelementptr inbounds i32, i32* %20, i64 0
store i32 %19, i32* %21
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 104
%24 = sext i32 %23 to i64
%25 = inttoptr i64 %24 to i32*
%26 = load volatile i32, i32* %25
%27 = load i32*, i32** %4
%28 = getelementptr inbounds i32, i32* %27, i64 1
store i32 %26, i32* %28
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 100
%31 = sext i32 %30 to i64
%32 = inttoptr i64 %31 to i32*
%33 = load volatile i32, i32* %32
%34 = load i32*, i32** %4
%35 = getelementptr inbounds i32, i32* %34, i64 2
store i32 %33, i32* %35
%36 = load i32, i32* %3
%37 = add nsw i32 %36, 96
%38 = sext i32 %37 to i64
%39 = inttoptr i64 %38 to i32*
%40 = load volatile i32, i32* %39
%41 = load i32*, i32** %4
%42 = getelementptr inbounds i32, i32* %41, i64 3
store i32 %40, i32* %42
ret void
}

LLVM IR (-O2):
define void @AESDataRead(i32 %0, i32* nocapture writeonly %1) {
%3 = add nsw i32 %0, 80
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
br label %6
6: ; preds = %6, %2
%7 = load volatile i32, i32* %5
%8 = and i32 %7, 1
%9 = icmp eq i32 %8, 0
br i1 %9, label %6, label %10
10: ; preds = %6
%11 = add nsw i32 %0, 108
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
store i32 %14, i32* %1
%15 = add nsw i32 %0, 104
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
%18 = load volatile i32, i32* %17
%19 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %18, i32* %19
%20 = add nsw i32 %0, 100
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to i32*
%23 = load volatile i32, i32* %22
%24 = getelementptr inbounds i32, i32* %1, i64 2
store i32 %23, i32* %24
%25 = add nsw i32 %0, 96
%26 = sext i32 %25 to i64
%27 = inttoptr i64 %26 to i32*
%28 = load volatile i32, i32* %27
%29 = getelementptr inbounds i32, i32* %1, i64 3
store i32 %28, i32* %29
ret void
}