#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 AESIVRead(uint32_t ui32Base, uint32_t *pui32IVData) {
  ;
  while ((0x40000000 & ((*((volatile uint32_t *)(ui32Base + 0x00000050))))) ==
         0) {
  }
  pui32IVData[0] = (*((volatile uint32_t *)((ui32Base + 0x00000040))));
  pui32IVData[1] = (*((volatile uint32_t *)((ui32Base + 0x00000044))));
  pui32IVData[2] = (*((volatile uint32_t *)((ui32Base + 0x00000048))));
  pui32IVData[3] = (*((volatile uint32_t *)((ui32Base + 0x0000004C))));
}


x86 assembly (clang, -O0):
<AESIVRead>:
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    $0x40000000,%eax
cmp    $0x0,%eax
jne    1128 <AESIVRead+0x28>
jmp    110b <AESIVRead+0xb>
mov    -0x4(%rbp),%eax
add    $0x40,%eax
cltq
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x44,%eax
cltq
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x4(%rbp),%eax
add    $0x48,%eax
cltq
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x4(%rbp),%eax
add    $0x4c,%eax
cltq
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AESIVRead>:
movslq %edi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
testl  $0x40000000,0x50(%rax)
je     1110 <AESIVRead+0x10>
mov    0x40(%rax),%ecx
mov    %ecx,(%rsi)
mov    0x44(%rax),%ecx
mov    %ecx,0x4(%rsi)
mov    0x48(%rax),%ecx
mov    %ecx,0x8(%rsi)
mov    0x4c(%rax),%eax
mov    %eax,0xc(%rsi)
ret

LLVM IR (-O0):
define void @AESIVRead(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 1073741824, %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, 64
%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, 68
%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, 72
%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, 76
%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 @AESIVRead(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, 1073741824
%9 = icmp eq i32 %8, 0
br i1 %9, label %6, label %10
10: ; preds = %6
%11 = add nsw i32 %0, 64
%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, 68
%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, 72
%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, 76
%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
}