#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 scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_mm_fpor(uint32_t fpor, uint32_t alternate) {
  if (0 == alternate) {
    printf("    FPOR    = 0x%08X\n", fpor);
  } else {
    printf("   AFPOR    = 0x%08X\n", fpor);
  }
  if (fpor & 0x00000008) {
    printf("                       %01x Low power BOR enabled, when main BOR "
           "disabled\n",
           0x00000008);
  } else {
    printf("                       %01x Low power BOR disabled\n", 0);
  }
  if (fpor & 0x00000004) {
    printf("                       %01x Retention regulator disabled\n",
           0x00000004);
  } else {
    printf("                       %01x Retention regulator enabled, RETEN in "
           "sleep\n",
           0);
  }
  switch (fpor & 0x00000003) {
  case 0x00000003:
    printf("                       %01x Brown-out Reset enabled in HW, SBOREN "
           "bit is disabled\n",
           0x00000003);
    break;
  case 0x00000002:
    printf("                       %01x Brown-out Reset in enabled only while "
           "device is active and disabled in Sleep; SBOREN bit is disabled\n",
           0x00000002);
    break;
  case 0x00000001:
    printf("                       %01x Brown-out Reset is controlled with the "
           "SBOREN bit setting\n",
           0x00000001);
    break;
  case 0x00000000:
    printf("                       %01x Brown-out Reset is disabled in HWM "
           "SBOREN bit is disabled\n",
           0x00000000);
    break;
  }
}


x86 assembly (clang, -O0):
<print_mm_fpor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1143 <print_mm_fpor+0x33>
mov    -0x8(%rbp),%rax
mov    %eax,%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
jmp    1155 <print_mm_fpor+0x45>
mov    -0x8(%rbp),%rax
mov    %eax,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
and    $0x8,%rax
cmp    $0x0,%rax
je     117d <print_mm_fpor+0x6d>
lea    0xece(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
jmp    118b <print_mm_fpor+0x7b>
lea    0xf03(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
and    $0x4,%rax
cmp    $0x0,%rax
je     11b3 <print_mm_fpor+0xa3>
lea    0xf17(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
jmp    11c1 <print_mm_fpor+0xb1>
lea    0xf3b(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
and    $0x3,%eax
mov    %rax,-0x18(%rbp)
sub    $0x3,%rax
ja     123a <print_mm_fpor+0x12a>
mov    -0x18(%rbp),%rax
lea    0xe1f(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf4d(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
jmp    123a <print_mm_fpor+0x12a>
lea    0xf8a(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
jmp    123a <print_mm_fpor+0x12a>
lea    0xff6(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
jmp    123a <print_mm_fpor+0x12a>
lea    0x1037(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_mm_fpor>:
push   %rbx
mov    %rdi,%rbx
test   %rsi,%rsi
lea    0xef2(%rip),%rax
lea    0xf01(%rip),%rdi
cmove  %rax,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
test   $0x8,%bl
jne    1140 <print_mm_fpor+0x30>
lea    0xf4b(%rip),%rdi
xor    %esi,%esi
jmp    114c <print_mm_fpor+0x3c>
lea    0xef5(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
test   $0x4,%bl
jne    1177 <print_mm_fpor+0x67>
lea    0xf98(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
and    $0x3,%ebx
lea    0xe92(%rip),%rax
movslq (%rax,%rbx,4),%rcx
add    %rax,%rcx
jmp    *%rcx
lea    0xf3d(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
and    $0x3,%ebx
lea    0xe6e(%rip),%rax
movslq (%rax,%rbx,4),%rcx
add    %rax,%rcx
jmp    *%rcx
lea    0x10c8(%rip),%rdi
xor    %esi,%esi
pop    %rbx
jmp    1030 <printf@plt>
lea    0xfe0(%rip),%rdi
mov    $0x2,%esi
pop    %rbx
jmp    1030 <printf@plt>
lea    0xf7b(%rip),%rdi
mov    $0x3,%esi
pop    %rbx
jmp    1030 <printf@plt>
lea    0x103e(%rip),%rdi
mov    $0x1,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c" FPOR = 0x%08X\0A\00"
@.str.1 = [22 x i8] c" AFPOR = 0x%08X\0A\00"
@.str.2 = [75 x i8] c" %01x Low power BOR enabled, when main BOR disabled\0A\00"
@.str.3 = [52 x i8] c" %01x Low power BOR disabled\0A\00"
@.str.4 = [58 x i8] c" %01x Retention regulator disabled\0A\00"
@.str.5 = [73 x i8] c" %01x Retention regulator enabled, RETEN in sleep\0A\00"
@.str.6 = [83 x i8] c" %01x Brown-out Reset enabled in HW, SBOREN bit is disabled\0A\00"
@.str.7 = [130 x i8] c" %01x Brown-out Reset in enabled only while device is active and disabled in Sleep; SBOREN bit is disabled\0A\00"
@.str.8 = [87 x i8] c" %01x Brown-out Reset is controlled with the SBOREN bit setting\0A\00"
@.str.9 = [87 x i8] c" %01x Brown-out Reset is disabled in HWM SBOREN bit is disabled\0A\00"
define void @print_mm_fpor(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp eq i64 0, %5
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i64, i64* %3
%9 = trunc i64 %8 to i32
%10 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %15
11: ; preds = %2
%12 = load i64, i64* %3
%13 = trunc i64 %12 to i32
%14 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %11, %7
%16 = load i64, i64* %3
%17 = and i64 %16, 8
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = call i32 @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.2, i64 0, i64 0), i32 8)
br label %23
21: ; preds = %15
%22 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0), i32 0)
br label %23
23: ; preds = %21, %19
%24 = load i64, i64* %3
%25 = and i64 %24, 4
%26 = icmp ne i64 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %23
%28 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.4, i64 0, i64 0), i32 4)
br label %31
29: ; preds = %23
%30 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.5, i64 0, i64 0), i32 0)
br label %31
31: ; preds = %29, %27
%32 = load i64, i64* %3
%33 = and i64 %32, 3
switch i64 %33, label %42 [
i64 3, label %34
i64 2, label %36
i64 1, label %38
i64 0, label %40
]
34: ; preds = %31
%35 = call i32 @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.6, i64 0, i64 0), i32 3)
br label %42
36: ; preds = %31
%37 = call i32 @printf(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str.7, i64 0, i64 0), i32 2)
br label %42
38: ; preds = %31
%39 = call i32 @printf(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.8, i64 0, i64 0), i32 1)
br label %42
40: ; preds = %31
%41 = call i32 @printf(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.9, i64 0, i64 0), i32 0)
br label %42
42: ; preds = %31, %40, %38, %36, %34
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c" FPOR = 0x%08X\0A\00"
@.str.1 = [22 x i8] c" AFPOR = 0x%08X\0A\00"
@.str.2 = [75 x i8] c" %01x Low power BOR enabled, when main BOR disabled\0A\00"
@.str.3 = [52 x i8] c" %01x Low power BOR disabled\0A\00"
@.str.4 = [58 x i8] c" %01x Retention regulator disabled\0A\00"
@.str.5 = [73 x i8] c" %01x Retention regulator enabled, RETEN in sleep\0A\00"
@.str.6 = [83 x i8] c" %01x Brown-out Reset enabled in HW, SBOREN bit is disabled\0A\00"
@.str.7 = [130 x i8] c" %01x Brown-out Reset in enabled only while device is active and disabled in Sleep; SBOREN bit is disabled\0A\00"
@.str.8 = [87 x i8] c" %01x Brown-out Reset is controlled with the SBOREN bit setting\0A\00"
@.str.9 = [87 x i8] c" %01x Brown-out Reset is disabled in HWM SBOREN bit is disabled\0A\00"
define void @print_mm_fpor(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
%4 = trunc i64 %0 to i32
%5 = select i1 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 @printf(i8* %5, i32 %4)
%7 = and i64 %0, 8
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = tail call i32 @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.2, i64 0, i64 0), i32 8)
br label %13
11: ; preds = %2
%12 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0), i32 0)
br label %13
13: ; preds = %11, %9
%14 = and i64 %0, 4
%15 = icmp eq i64 %14, 0
br i1 %15, label %18, label %16
16: ; preds = %13
%17 = tail call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.4, i64 0, i64 0), i32 4)
br label %20
18: ; preds = %13
%19 = tail call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.5, i64 0, i64 0), i32 0)
br label %20
20: ; preds = %18, %16
%21 = and i64 %0, 3
switch i64 %21, label %30 [
i64 3, label %22
i64 2, label %24
i64 1, label %26
i64 0, label %28
]
22: ; preds = %20
%23 = tail call i32 @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.6, i64 0, i64 0), i32 3)
br label %31
24: ; preds = %20
%25 = tail call i32 @printf(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str.7, i64 0, i64 0), i32 2)
br label %31
26: ; preds = %20
%27 = tail call i32 @printf(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.8, i64 0, i64 0), i32 1)
br label %31
28: ; preds = %20
%29 = tail call i32 @printf(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.9, i64 0, i64 0), i32 0)
br label %31
30: ; preds = %20
unreachable
31: ; preds = %28, %26, %24, %22
ret void
}