#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*/ DbgPrintf(char *, ...);
void CMx_FaultDecoder(uint32_t *pStackFrame) {
  uint32_t cfsr = (*((volatile uint32_t *)(0xE000ED28)));
  uint32_t mmfar = (*((volatile uint32_t *)(0xE000ED34)));
  uint32_t bfar = (*((volatile uint32_t *)(0xE000ED38)));
  DbgPrintf("\n*** Fault occurred ***\n\n");
  DbgPrintf("Stack Frame\n----------\n");
  DbgPrintf(
      "   R0       R1       R2       R3      R12       LR       PC     xPSR\n");
  for (uint32_t i = 0; i < 8; i++) {
    DbgPrintf("%08X ", pStackFrame[i]);
  }
  DbgPrintf("\n\n");
  DbgPrintf("MMFSR:");
  if (cfsr & 0x00000080) {
    DbgPrintf(" MMARVALID");
  }
  if (cfsr & 0x00000020) {
    DbgPrintf(" MLSPERR");
  }
  if (cfsr & 0x00000010) {
    DbgPrintf(" MSTKERR");
  }
  if (cfsr & 0x00000008) {
    DbgPrintf(" MUNSTKERR");
  }
  if (cfsr & 0x00000002) {
    DbgPrintf(" DACCVIOL");
  }
  if (cfsr & 0x00000001) {
    DbgPrintf(" IACCVIOL");
  }
  DbgPrintf("\n");
  DbgPrintf("MMFAR: %08X\n\n", mmfar);
  DbgPrintf("BFSR: ");
  if (cfsr & 0x00008000) {
    DbgPrintf(" BFARVALID");
  }
  if (cfsr & 0x00002000) {
    DbgPrintf(" LSPERR");
  }
  if (cfsr & 0x00001000) {
    DbgPrintf(" STKERR");
  }
  if (cfsr & 0x00000800) {
    DbgPrintf(" UNSTKERR");
  }
  if (cfsr & 0x00000400) {
    DbgPrintf(" IMPRECISERR");
  }
  if (cfsr & 0x00000200) {
    DbgPrintf(" PRECISERR");
  }
  if (cfsr & 0x00000100) {
    DbgPrintf(" IBUSERR");
  }
  DbgPrintf("\n");
  DbgPrintf("BFAR: %08X\n\n", bfar);
  DbgPrintf("UFSR :");
  if (cfsr & 0x02000000) {
    DbgPrintf(" DIVBYZERO");
  }
  if (cfsr & 0x01000000) {
    DbgPrintf(" UNALIGNED");
  }
  if (cfsr & 0x00080000) {
    DbgPrintf(" NOCP");
  }
  if (cfsr & 0x00040000) {
    DbgPrintf(" INVPC");
  }
  if (cfsr & 0x00020000) {
    DbgPrintf(" INVSTATE");
  }
  if (cfsr & 0x00010000) {
    DbgPrintf(" UNDEFINSTR");
  }
  DbgPrintf("\n\n");
}


x86 assembly (clang, -O0):
<CMx_FaultDecoder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xe000ed28,%eax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0xe000ed34,%eax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    $0xe000ed38,%eax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <DbgPrintf@plt>
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <DbgPrintf@plt>
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <DbgPrintf@plt>
movl   $0x0,-0x18(%rbp)
cmpl   $0x8,-0x18(%rbp)
jge    119c <CMx_FaultDecoder+0x8c>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xef1(%rip),%rdi
mov    $0x0,%al
call   1030 <DbgPrintf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    116b <CMx_FaultDecoder+0x5b>
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1030 <DbgPrintf@plt>
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <DbgPrintf@plt>
mov    -0xc(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     11d7 <CMx_FaultDecoder+0xc7>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <DbgPrintf@plt>
mov    -0xc(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     11f4 <CMx_FaultDecoder+0xe4>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <DbgPrintf@plt>
mov    -0xc(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     1211 <CMx_FaultDecoder+0x101>
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <DbgPrintf@plt>
mov    -0xc(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     122e <CMx_FaultDecoder+0x11e>
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1030 <DbgPrintf@plt>
mov    -0xc(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     124b <CMx_FaultDecoder+0x13b>
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <DbgPrintf@plt>
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1268 <CMx_FaultDecoder+0x158>
lea    0xe56(%rip),%rdi
mov    $0x0,%al
call   1030 <DbgPrintf@plt>
lea    0xda9(%rip),%rdi
mov    $0x0,%al
call   1030 <DbgPrintf@plt>
mov    -0x10(%rbp),%esi
lea    0xe41(%rip),%rdi
mov    $0x0,%al
call   1030 <DbgPrintf@plt>
lea    0xe41(%rip),%rdi
mov    $0x0,%al
call   1030 <DbgPrintf@plt>
mov    -0xc(%rbp),%eax
and    $0x8000,%eax
cmp    $0x0,%eax
je     12b4 <CMx_FaultDecoder+0x1a4>
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1030 <DbgPrintf@plt>
mov    -0xc(%rbp),%eax
and    $0x2000,%eax
cmp    $0x0,%eax
je     12d3 <CMx_FaultDecoder+0x1c3>
lea    0xe15(%rip),%rdi
mov    $0x0,%al
call   1030 <DbgPrintf@plt>
mov    -0xc(%rbp),%eax
and    $0x1000,%eax
cmp    $0x0,%eax
je     12f2 <CMx_FaultDecoder+0x1e2>
lea    0xdfe(%rip),%rdi
mov    $0x0,%al
call   1030 <DbgPrintf@plt>
mov    -0xc(%rbp),%eax
and    $0x800,%eax
cmp    $0x0,%eax
je     1311 <CMx_FaultDecoder+0x201>
lea    0xde7(%rip),%rdi
mov    $0x0,%al
call   1030 <DbgPrintf@plt>
mov    -0xc(%rbp),%eax
and    $0x400,%eax
cmp    $0x0,%eax
je     1330 <CMx_FaultDecoder+0x220>
lea    0xdd2(%rip),%rdi
mov    $0x0,%al
call   1030 <DbgPrintf@plt>
mov    -0xc(%rbp),%eax
and    $0x200,%eax
cmp    $0x0,%eax
je     134f <CMx_FaultDecoder+0x23f>
lea    0xdc0(%rip),%rdi
mov    $0x0,%al
call   1030 <DbgPrintf@plt>
mov    -0xc(%rbp),%eax
and    $0x100,%eax
cmp    $0x0,%eax
je     136e <CMx_FaultDecoder+0x25e>
lea    0xdac(%rip),%rdi
mov    $0x0,%al
call   1030 <DbgPrintf@plt>
lea    0xca3(%rip),%rdi
mov    $0x0,%al
call   1030 <DbgPrintf@plt>
mov    -0x14(%rbp),%esi
lea    0xd96(%rip),%rdi
mov    $0x0,%al
call   1030 <DbgPrintf@plt>
lea    0xd95(%rip),%rdi
mov    $0x0,%al
call   1030 <DbgPrintf@plt>
mov    -0xc(%rbp),%eax
and    $0x2000000,%eax
cmp    $0x0,%eax
je     13ba <CMx_FaultDecoder+0x2aa>
lea    0xd7d(%rip),%rdi
mov    $0x0,%al
call   1030 <DbgPrintf@plt>
mov    -0xc(%rbp),%eax
and    $0x1000000,%eax
cmp    $0x0,%eax
je     13d9 <CMx_FaultDecoder+0x2c9>
lea    0xd69(%rip),%rdi
mov    $0x0,%al
call   1030 <DbgPrintf@plt>
mov    -0xc(%rbp),%eax
and    $0x80000,%eax
cmp    $0x0,%eax
je     13f8 <CMx_FaultDecoder+0x2e8>
lea    0xd55(%rip),%rdi
mov    $0x0,%al
call   1030 <DbgPrintf@plt>
mov    -0xc(%rbp),%eax
and    $0x40000,%eax
cmp    $0x0,%eax
je     1417 <CMx_FaultDecoder+0x307>
lea    0xd3c(%rip),%rdi
mov    $0x0,%al
call   1030 <DbgPrintf@plt>
mov    -0xc(%rbp),%eax
and    $0x20000,%eax
cmp    $0x0,%eax
je     1436 <CMx_FaultDecoder+0x326>
lea    0xd24(%rip),%rdi
mov    $0x0,%al
call   1030 <DbgPrintf@plt>
mov    -0xc(%rbp),%eax
and    $0x10000,%eax
cmp    $0x0,%eax
je     1455 <CMx_FaultDecoder+0x345>
lea    0xd0f(%rip),%rdi
mov    $0x0,%al
call   1030 <DbgPrintf@plt>
lea    0xbbb(%rip),%rdi
mov    $0x0,%al
call   1030 <DbgPrintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CMx_FaultDecoder>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdi,%rbx
mov    $0xe000ed28,%eax
mov    (%rax),%r12d
mov    0xc(%rax),%r15d
mov    0x10(%rax),%r14d
lea    0xece(%rip),%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
lea    0xeda(%rip),%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
lea    0xee4(%rip),%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
mov    (%rbx),%esi
lea    0xf1a(%rip),%rbp
mov    %rbp,%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
mov    0x4(%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
mov    0x8(%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
mov    0xc(%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
mov    0x10(%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
mov    0x14(%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
mov    0x18(%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
mov    0x1c(%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
lea    0xe4d(%rip),%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
lea    0xea6(%rip),%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
test   $0x80,%r12b
jne    1352 <CMx_FaultDecoder+0x242>
test   $0x20,%r12b
jne    136a <CMx_FaultDecoder+0x25a>
test   $0x10,%r12b
jne    1382 <CMx_FaultDecoder+0x272>
test   $0x8,%r12b
jne    139a <CMx_FaultDecoder+0x28a>
test   $0x2,%r12b
jne    13b2 <CMx_FaultDecoder+0x2a2>
test   $0x1,%r12b
je     1225 <CMx_FaultDecoder+0x115>
lea    0xe99(%rip),%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
lea    0xdec(%rip),%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
lea    0xe87(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
lea    0xe84(%rip),%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
test   $0x8000,%r12d
jne    13cf <CMx_FaultDecoder+0x2bf>
test   $0x2000,%r12d
jne    13ea <CMx_FaultDecoder+0x2da>
test   $0x1000,%r12d
jne    1405 <CMx_FaultDecoder+0x2f5>
test   $0x800,%r12d
jne    1420 <CMx_FaultDecoder+0x310>
test   $0x400,%r12d
jne    143b <CMx_FaultDecoder+0x32b>
test   $0x200,%r12d
jne    1456 <CMx_FaultDecoder+0x346>
test   $0x100,%r12d
je     12b7 <CMx_FaultDecoder+0x1a7>
lea    0xe63(%rip),%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
lea    0xd5a(%rip),%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
lea    0xe50(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
lea    0xe4c(%rip),%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
test   $0x2000000,%r12d
jne    1476 <CMx_FaultDecoder+0x366>
test   $0x1000000,%r12d
jne    1491 <CMx_FaultDecoder+0x381>
test   $0x80000,%r12d
jne    14ac <CMx_FaultDecoder+0x39c>
test   $0x40000,%r12d
jne    14c7 <CMx_FaultDecoder+0x3b7>
test   $0x20000,%r12d
jne    14e2 <CMx_FaultDecoder+0x3d2>
test   $0x10000,%r12d
je     133c <CMx_FaultDecoder+0x22c>
lea    0xe28(%rip),%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
lea    0xcd4(%rip),%rdi
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <DbgPrintf@plt>
lea    0xd2c(%rip),%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
test   $0x20,%r12b
je     11f3 <CMx_FaultDecoder+0xe3>
lea    0xd1f(%rip),%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
test   $0x10,%r12b
je     11fd <CMx_FaultDecoder+0xed>
lea    0xd10(%rip),%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
test   $0x8,%r12b
je     1207 <CMx_FaultDecoder+0xf7>
lea    0xd01(%rip),%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
test   $0x2,%r12b
je     1211 <CMx_FaultDecoder+0x101>
lea    0xcf4(%rip),%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
test   $0x1,%r12b
jne    1217 <CMx_FaultDecoder+0x107>
jmp    1225 <CMx_FaultDecoder+0x115>
lea    0xd00(%rip),%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
test   $0x2000,%r12d
je     126c <CMx_FaultDecoder+0x15c>
lea    0xcf0(%rip),%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
test   $0x1000,%r12d
je     1279 <CMx_FaultDecoder+0x169>
lea    0xcdd(%rip),%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
test   $0x800,%r12d
je     1286 <CMx_FaultDecoder+0x176>
lea    0xcca(%rip),%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
test   $0x400,%r12d
je     1293 <CMx_FaultDecoder+0x183>
lea    0xcb9(%rip),%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
test   $0x200,%r12d
je     12a0 <CMx_FaultDecoder+0x190>
lea    0xcab(%rip),%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
test   $0x100,%r12d
jne    12a9 <CMx_FaultDecoder+0x199>
jmp    12b7 <CMx_FaultDecoder+0x1a7>
lea    0xcb3(%rip),%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
test   $0x1000000,%r12d
je     12fe <CMx_FaultDecoder+0x1ee>
lea    0xca3(%rip),%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
test   $0x80000,%r12d
je     130b <CMx_FaultDecoder+0x1fb>
lea    0xc93(%rip),%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
test   $0x40000,%r12d
je     1318 <CMx_FaultDecoder+0x208>
lea    0xc7e(%rip),%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
test   $0x20000,%r12d
je     1325 <CMx_FaultDecoder+0x215>
lea    0xc6a(%rip),%rdi
xor    %eax,%eax
call   1030 <DbgPrintf@plt>
test   $0x10000,%r12d
jne    132e <CMx_FaultDecoder+0x21e>
jmp    133c <CMx_FaultDecoder+0x22c>

LLVM IR (-O0):
@.str = [26 x i8] c"\0A*** Fault occurred ***\0A\0A\00"
@.str.1 = [24 x i8] c"Stack Frame\0A----------\0A\00"
@.str.2 = [70 x i8] c" R0 R1 R2 R3 R12 LR PC xPSR\0A\00"
@.str.3 = [6 x i8] c"%08X \00"
@.str.4 = [3 x i8] c"\0A\0A\00"
@.str.5 = [7 x i8] c"MMFSR:\00"
@.str.6 = [11 x i8] c" MMARVALID\00"
@.str.7 = [9 x i8] c" MLSPERR\00"
@.str.8 = [9 x i8] c" MSTKERR\00"
@.str.9 = [11 x i8] c" MUNSTKERR\00"
@.str.10 = [10 x i8] c" DACCVIOL\00"
@.str.11 = [10 x i8] c" IACCVIOL\00"
@.str.12 = [2 x i8] c"\0A\00"
@.str.13 = [14 x i8] c"MMFAR: %08X\0A\0A\00"
@.str.14 = [7 x i8] c"BFSR: \00"
@.str.15 = [11 x i8] c" BFARVALID\00"
@.str.16 = [8 x i8] c" LSPERR\00"
@.str.17 = [8 x i8] c" STKERR\00"
@.str.18 = [10 x i8] c" UNSTKERR\00"
@.str.19 = [13 x i8] c" IMPRECISERR\00"
@.str.20 = [11 x i8] c" PRECISERR\00"
@.str.21 = [9 x i8] c" IBUSERR\00"
@.str.22 = [13 x i8] c"BFAR: %08X\0A\0A\00"
@.str.23 = [7 x i8] c"UFSR :\00"
@.str.24 = [11 x i8] c" DIVBYZERO\00"
@.str.25 = [11 x i8] c" UNALIGNED\00"
@.str.26 = [6 x i8] c" NOCP\00"
@.str.27 = [7 x i8] c" INVPC\00"
@.str.28 = [10 x i8] c" INVSTATE\00"
@.str.29 = [12 x i8] c" UNDEFINSTR\00"
define void @CMx_FaultDecoder(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %2
%7 = load volatile i32, i32* inttoptr (i64 3758157096 to i32*)
store i32 %7, i32* %3
%8 = load volatile i32, i32* inttoptr (i64 3758157108 to i32*)
store i32 %8, i32* %4
%9 = load volatile i32, i32* inttoptr (i64 3758157112 to i32*)
store i32 %9, i32* %5
%10 = call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %6
br label %13
13: ; preds = %23, %1
%14 = load i32, i32* %6
%15 = icmp slt i32 %14, 8
br i1 %15, label %16, label %26
16: ; preds = %13
%17 = load i32*, i32** %2
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
%21 = load i32, i32* %20
%22 = call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %21)
br label %23
23: ; preds = %16
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
store i32 %25, i32* %6
br label %13
26: ; preds = %13
%27 = call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%28 = call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%29 = load i32, i32* %3
%30 = and i32 %29, 128
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %26
%33 = call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
br label %34
34: ; preds = %32, %26
%35 = load i32, i32* %3
%36 = and i32 %35, 32
%37 = icmp ne i32 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %34
%39 = call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
br label %40
40: ; preds = %38, %34
%41 = load i32, i32* %3
%42 = and i32 %41, 16
%43 = icmp ne i32 %42, 0
br i1 %43, label %44, label %46
44: ; preds = %40
%45 = call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
br label %46
46: ; preds = %44, %40
%47 = load i32, i32* %3
%48 = and i32 %47, 8
%49 = icmp ne i32 %48, 0
br i1 %49, label %50, label %52
50: ; preds = %46
%51 = call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0))
br label %52
52: ; preds = %50, %46
%53 = load i32, i32* %3
%54 = and i32 %53, 2
%55 = icmp ne i32 %54, 0
br i1 %55, label %56, label %58
56: ; preds = %52
%57 = call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0))
br label %58
58: ; preds = %56, %52
%59 = load i32, i32* %3
%60 = and i32 %59, 1
%61 = icmp ne i32 %60, 0
br i1 %61, label %62, label %64
62: ; preds = %58
%63 = call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0))
br label %64
64: ; preds = %62, %58
%65 = call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
%66 = load i32, i32* %4
%67 = call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0), i32 %66)
%68 = call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0))
%69 = load i32, i32* %3
%70 = and i32 %69, 32768
%71 = icmp ne i32 %70, 0
br i1 %71, label %72, label %74
72: ; preds = %64
%73 = call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.15, i64 0, i64 0))
br label %74
74: ; preds = %72, %64
%75 = load i32, i32* %3
%76 = and i32 %75, 8192
%77 = icmp ne i32 %76, 0
br i1 %77, label %78, label %80
78: ; preds = %74
%79 = call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0))
br label %80
80: ; preds = %78, %74
%81 = load i32, i32* %3
%82 = and i32 %81, 4096
%83 = icmp ne i32 %82, 0
br i1 %83, label %84, label %86
84: ; preds = %80
%85 = call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0))
br label %86
86: ; preds = %84, %80
%87 = load i32, i32* %3
%88 = and i32 %87, 2048
%89 = icmp ne i32 %88, 0
br i1 %89, label %90, label %92
90: ; preds = %86
%91 = call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i64 0, i64 0))
br label %92
92: ; preds = %90, %86
%93 = load i32, i32* %3
%94 = and i32 %93, 1024
%95 = icmp ne i32 %94, 0
br i1 %95, label %96, label %98
96: ; preds = %92
%97 = call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.19, i64 0, i64 0))
br label %98
98: ; preds = %96, %92
%99 = load i32, i32* %3
%100 = and i32 %99, 512
%101 = icmp ne i32 %100, 0
br i1 %101, label %102, label %104
102: ; preds = %98
%103 = call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.20, i64 0, i64 0))
br label %104
104: ; preds = %102, %98
%105 = load i32, i32* %3
%106 = and i32 %105, 256
%107 = icmp ne i32 %106, 0
br i1 %107, label %108, label %110
108: ; preds = %104
%109 = call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.21, i64 0, i64 0))
br label %110
110: ; preds = %108, %104
%111 = call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
%112 = load i32, i32* %5
%113 = call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.22, i64 0, i64 0), i32 %112)
%114 = call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.23, i64 0, i64 0))
%115 = load i32, i32* %3
%116 = and i32 %115, 33554432
%117 = icmp ne i32 %116, 0
br i1 %117, label %118, label %120
118: ; preds = %110
%119 = call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.24, i64 0, i64 0))
br label %120
120: ; preds = %118, %110
%121 = load i32, i32* %3
%122 = and i32 %121, 16777216
%123 = icmp ne i32 %122, 0
br i1 %123, label %124, label %126
124: ; preds = %120
%125 = call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.25, i64 0, i64 0))
br label %126
126: ; preds = %124, %120
%127 = load i32, i32* %3
%128 = and i32 %127, 524288
%129 = icmp ne i32 %128, 0
br i1 %129, label %130, label %132
130: ; preds = %126
%131 = call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i64 0, i64 0))
br label %132
132: ; preds = %130, %126
%133 = load i32, i32* %3
%134 = and i32 %133, 262144
%135 = icmp ne i32 %134, 0
br i1 %135, label %136, label %138
136: ; preds = %132
%137 = call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.27, i64 0, i64 0))
br label %138
138: ; preds = %136, %132
%139 = load i32, i32* %3
%140 = and i32 %139, 131072
%141 = icmp ne i32 %140, 0
br i1 %141, label %142, label %144
142: ; preds = %138
%143 = call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.28, i64 0, i64 0))
br label %144
144: ; preds = %142, %138
%145 = load i32, i32* %3
%146 = and i32 %145, 65536
%147 = icmp ne i32 %146, 0
br i1 %147, label %148, label %150
148: ; preds = %144
%149 = call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.29, i64 0, i64 0))
br label %150
150: ; preds = %148, %144
%151 = call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"\0A*** Fault occurred ***\0A\0A\00"
@.str.1 = [24 x i8] c"Stack Frame\0A----------\0A\00"
@.str.2 = [70 x i8] c" R0 R1 R2 R3 R12 LR PC xPSR\0A\00"
@.str.3 = [6 x i8] c"%08X \00"
@.str.4 = [3 x i8] c"\0A\0A\00"
@.str.5 = [7 x i8] c"MMFSR:\00"
@.str.6 = [11 x i8] c" MMARVALID\00"
@.str.7 = [9 x i8] c" MLSPERR\00"
@.str.8 = [9 x i8] c" MSTKERR\00"
@.str.9 = [11 x i8] c" MUNSTKERR\00"
@.str.10 = [10 x i8] c" DACCVIOL\00"
@.str.11 = [10 x i8] c" IACCVIOL\00"
@.str.12 = [2 x i8] c"\0A\00"
@.str.13 = [14 x i8] c"MMFAR: %08X\0A\0A\00"
@.str.14 = [7 x i8] c"BFSR: \00"
@.str.15 = [11 x i8] c" BFARVALID\00"
@.str.16 = [8 x i8] c" LSPERR\00"
@.str.17 = [8 x i8] c" STKERR\00"
@.str.18 = [10 x i8] c" UNSTKERR\00"
@.str.19 = [13 x i8] c" IMPRECISERR\00"
@.str.20 = [11 x i8] c" PRECISERR\00"
@.str.21 = [9 x i8] c" IBUSERR\00"
@.str.22 = [13 x i8] c"BFAR: %08X\0A\0A\00"
@.str.23 = [7 x i8] c"UFSR :\00"
@.str.24 = [11 x i8] c" DIVBYZERO\00"
@.str.25 = [11 x i8] c" UNALIGNED\00"
@.str.26 = [6 x i8] c" NOCP\00"
@.str.27 = [7 x i8] c" INVPC\00"
@.str.28 = [10 x i8] c" INVSTATE\00"
@.str.29 = [12 x i8] c" UNDEFINSTR\00"
define void @CMx_FaultDecoder(i32* nocapture %0) {
%2 = load volatile i32, i32* inttoptr (i64 3758157096 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 3758157108 to i32*)
%4 = load volatile i32, i32* inttoptr (i64 3758157112 to i32*)
%5 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.2, i64 0, i64 0))
%8 = load i32, i32* %0
%9 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds i32, i32* %0, i64 1
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %11)
%13 = getelementptr inbounds i32, i32* %0, i64 2
%14 = load i32, i32* %13
%15 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %14)
%16 = getelementptr inbounds i32, i32* %0, i64 3
%17 = load i32, i32* %16
%18 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %17)
%19 = getelementptr inbounds i32, i32* %0, i64 4
%20 = load i32, i32* %19
%21 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %20)
%22 = getelementptr inbounds i32, i32* %0, i64 5
%23 = load i32, i32* %22
%24 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %23)
%25 = getelementptr inbounds i32, i32* %0, i64 6
%26 = load i32, i32* %25
%27 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %26)
%28 = getelementptr inbounds i32, i32* %0, i64 7
%29 = load i32, i32* %28
%30 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %29)
%31 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%32 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%33 = and i32 %2, 128
%34 = icmp eq i32 %33, 0
br i1 %34, label %37, label %35
35: ; preds = %1
%36 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
br label %37
37: ; preds = %35, %1
%38 = and i32 %2, 32
%39 = icmp eq i32 %38, 0
br i1 %39, label %42, label %40
40: ; preds = %37
%41 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
br label %42
42: ; preds = %40, %37
%43 = and i32 %2, 16
%44 = icmp eq i32 %43, 0
br i1 %44, label %47, label %45
45: ; preds = %42
%46 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
br label %47
47: ; preds = %45, %42
%48 = and i32 %2, 8
%49 = icmp eq i32 %48, 0
br i1 %49, label %52, label %50
50: ; preds = %47
%51 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0))
br label %52
52: ; preds = %50, %47
%53 = and i32 %2, 2
%54 = icmp eq i32 %53, 0
br i1 %54, label %57, label %55
55: ; preds = %52
%56 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0))
br label %57
57: ; preds = %55, %52
%58 = and i32 %2, 1
%59 = icmp eq i32 %58, 0
br i1 %59, label %62, label %60
60: ; preds = %57
%61 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0))
br label %62
62: ; preds = %60, %57
%63 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
%64 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0), i32 %3)
%65 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0))
%66 = and i32 %2, 32768
%67 = icmp eq i32 %66, 0
br i1 %67, label %70, label %68
68: ; preds = %62
%69 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.15, i64 0, i64 0))
br label %70
70: ; preds = %68, %62
%71 = and i32 %2, 8192
%72 = icmp eq i32 %71, 0
br i1 %72, label %75, label %73
73: ; preds = %70
%74 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0))
br label %75
75: ; preds = %73, %70
%76 = and i32 %2, 4096
%77 = icmp eq i32 %76, 0
br i1 %77, label %80, label %78
78: ; preds = %75
%79 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0))
br label %80
80: ; preds = %78, %75
%81 = and i32 %2, 2048
%82 = icmp eq i32 %81, 0
br i1 %82, label %85, label %83
83: ; preds = %80
%84 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i64 0, i64 0))
br label %85
85: ; preds = %83, %80
%86 = and i32 %2, 1024
%87 = icmp eq i32 %86, 0
br i1 %87, label %90, label %88
88: ; preds = %85
%89 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.19, i64 0, i64 0))
br label %90
90: ; preds = %88, %85
%91 = and i32 %2, 512
%92 = icmp eq i32 %91, 0
br i1 %92, label %95, label %93
93: ; preds = %90
%94 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.20, i64 0, i64 0))
br label %95
95: ; preds = %93, %90
%96 = and i32 %2, 256
%97 = icmp eq i32 %96, 0
br i1 %97, label %100, label %98
98: ; preds = %95
%99 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.21, i64 0, i64 0))
br label %100
100: ; preds = %98, %95
%101 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
%102 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.22, i64 0, i64 0), i32 %4)
%103 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.23, i64 0, i64 0))
%104 = and i32 %2, 33554432
%105 = icmp eq i32 %104, 0
br i1 %105, label %108, label %106
106: ; preds = %100
%107 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.24, i64 0, i64 0))
br label %108
108: ; preds = %106, %100
%109 = and i32 %2, 16777216
%110 = icmp eq i32 %109, 0
br i1 %110, label %113, label %111
111: ; preds = %108
%112 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.25, i64 0, i64 0))
br label %113
113: ; preds = %111, %108
%114 = and i32 %2, 524288
%115 = icmp eq i32 %114, 0
br i1 %115, label %118, label %116
116: ; preds = %113
%117 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i64 0, i64 0))
br label %118
118: ; preds = %116, %113
%119 = and i32 %2, 262144
%120 = icmp eq i32 %119, 0
br i1 %120, label %123, label %121
121: ; preds = %118
%122 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.27, i64 0, i64 0))
br label %123
123: ; preds = %121, %118
%124 = and i32 %2, 131072
%125 = icmp eq i32 %124, 0
br i1 %125, label %128, label %126
126: ; preds = %123
%127 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.28, i64 0, i64 0))
br label %128
128: ; preds = %126, %123
%129 = and i32 %2, 65536
%130 = icmp eq i32 %129, 0
br i1 %130, label %133, label %131
131: ; preds = %128
%132 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.29, i64 0, i64 0))
br label %133
133: ; preds = %131, %128
%134 = tail call i32 (i8*, ...) @DbgPrintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
ret void
}