#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 */
bool DESIVSet(uint32_t ui32Base, uint32_t *pui32IVdata) {
  ;
  if (((*((volatile uint32_t *)(ui32Base + 0x00000020))) & 0x80000000) == 0) {
    return (false);
  }
  (*((volatile uint32_t *)(ui32Base + 0x00000018))) = pui32IVdata[0];
  (*((volatile uint32_t *)(ui32Base + 0x0000001C))) = pui32IVdata[1];
  return (true);
}


x86 assembly (clang, -O0):
<DESIVSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%eax
cltq
mov    (%rax),%eax
and    $0x80000000,%eax
cmp    $0x0,%eax
jne    112f <DESIVSet+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1157 <DESIVSet+0x57>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%eax
add    $0x18,%eax
cltq
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x8(%rbp),%eax
add    $0x1c,%eax
cltq
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DESIVSet>:
movslq %edi,%rcx
xor    %eax,%eax
cmpl   $0x0,0x20(%rcx)
js     110c <DESIVSet+0xc>
ret
mov    (%rsi),%eax
mov    %eax,0x18(%rcx)
mov    0x4(%rsi),%eax
mov    %eax,0x1c(%rcx)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @DESIVSet(i32 %0, i32* nocapture %1) {
%3 = add nsw i32 %0, 32
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = icmp sgt i32 %6, -1
br i1 %7, label %18, label %8
8: ; preds = %2
%9 = load i32, i32* %1
%10 = add nsw i32 %0, 24
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
store volatile i32 %9, i32* %12
%13 = getelementptr inbounds i32, i32* %1, i64 1
%14 = load i32, i32* %13
%15 = add nsw i32 %0, 28
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
store volatile i32 %14, i32* %17
br label %18
18: ; preds = %2, %8
%19 = phi i32 [ 1, %8 ], [ 0, %2 ]
ret i32 %19
}