#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*/ instr_out(int *, int, unsigned int, char *, char *, ...);
void state_base_out(uint32_t *data, uint32_t hw_offset, unsigned int index,
                    char *name) {
  if (data[index] & 1) {
    instr_out(data, hw_offset, index, "%s state base address 0x%08x\n", name,
              data[index] & ~1);
  } else {
    instr_out(data, hw_offset, index, "%s state base not updated\n", name);
  }
}


x86 assembly (clang, -O0):
<state_base_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,4),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     116c <state_base_out+0x5c>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%r8
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,4),%r9d
and    $0xfffffffe,%r9d
lea    0xea0(%rip),%rcx
mov    $0x0,%al
call   1030 <instr_out@plt>
jmp    1188 <state_base_out+0x78>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%r8
lea    0xe9d(%rip),%rcx
mov    $0x0,%al
call   1030 <instr_out@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<state_base_out>:
mov    %rcx,%r8
mov    %edx,%eax
mov    (%rdi,%rax,4),%r9d
test   $0x1,%r9b
jne    112d <state_base_out+0x1d>
lea    0xef8(%rip),%rcx
xor    %eax,%eax
jmp    1030 <instr_out@plt>
and    $0xfffffffe,%r9d
lea    0xec8(%rip),%rcx
xor    %eax,%eax
jmp    1030 <instr_out@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"%s state base address 0x%08x\0A\00"
@.str.1 = [27 x i8] c"%s state base not updated\0A\00"
define void @state_base_out(i32* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %7
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
%13 = load i32, i32* %12
%14 = and i32 %13, 1
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %28
16: ; preds = %4
%17 = load i32*, i32** %5
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = load i8*, i8** %8
%21 = load i32*, i32** %5
%22 = load i32, i32* %7
%23 = zext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %21, i64 %23
%25 = load i32, i32* %24
%26 = and i32 %25, -2
%27 = call i32 (i32*, i32, i32, i8*, i8*, ...) @instr_out(i32* %17, i32 %18, i32 %19, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %20, i32 %26)
br label %34
28: ; preds = %4
%29 = load i32*, i32** %5
%30 = load i32, i32* %6
%31 = load i32, i32* %7
%32 = load i8*, i8** %8
%33 = call i32 (i32*, i32, i32, i8*, i8*, ...) @instr_out(i32* %29, i32 %30, i32 %31, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %32)
br label %34
34: ; preds = %28, %16
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"%s state base address 0x%08x\0A\00"
@.str.1 = [27 x i8] c"%s state base not updated\0A\00"
define void @state_base_out(i32* %0, i32 %1, i32 %2, i8* %3) {
%5 = zext i32 %2 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = and i32 %7, 1
%9 = icmp eq i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %4
%11 = and i32 %7, -2
%12 = tail call i32 (i32*, i32, i32, i8*, i8*, ...) @instr_out(i32* %0, i32 %1, i32 %2, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %11)
br label %15
13: ; preds = %4
%14 = tail call i32 (i32*, i32, i32, i8*, i8*, ...) @instr_out(i32* %0, i32 %1, i32 %2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %3)
br label %15
15: ; preds = %13, %10
ret void
}