#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_fdevopt(uint32_t fdevopt, uint32_t alternate) {
  if (0 == alternate) {
    printf("    FDEVOPT = 0x%08X\n", fdevopt);
  } else {
    printf("   AFDEVOPT = 0x%08X\n", fdevopt);
  }
  printf("              0x%04X     USERID\n", (fdevopt & 0xffff0000) >> 16);
  if (fdevopt & 0x00008000) {
    printf("                    %01x    VBUSON pin: controlled by USB (GPM "
           "series only)\n",
           0x00008000 >> 12);
  } else {
    printf("                    %01x    VBUSON pin: controlled by port "
           "function (GPM series only)\n",
           0);
  }
  if (fdevopt & 0x00004000) {
    printf("                    %01x    USBID pin: controlled by USB (GPM "
           "series only)\n",
           0x00004000 >> 12);
  } else {
    printf("                    %01x    USBID pin: controlled by port function "
           "(GPM series only)\n",
           0);
  }
  if (fdevopt & 0x00000010) {
    printf("                      %01x  I2C1 is on pins RB8 & RB9 (GPM series "
           "only)\n",
           0x00000010 >> 4);
  } else {
    printf("                      %01x  I2C1 is on alt. pins, RB5 & RC9 (GPM "
           "series only)\n",
           0);
  }
  if (fdevopt & 0x00000008) {
    printf("                       %01x SOSC normal power mode\n", 0x00000008);
  } else {
    printf("                       %01x SOSC High power mode\n", 0);
  }
}


x86 assembly (clang, -O0):
<print_mm_fdevopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1143 <print_mm_fdevopt+0x33>
mov    -0x8(%rbp),%rax
mov    %eax,%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
jmp    1155 <print_mm_fdevopt+0x45>
mov    -0x8(%rbp),%rax
mov    %eax,%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
movabs $0xffff0000,%rax
and    -0x8(%rbp),%rax
sar    $0x10,%rax
mov    %eax,%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
and    $0x8000,%rax
cmp    $0x0,%rax
je     119f <print_mm_fdevopt+0x8f>
lea    0xebd(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
jmp    11ad <print_mm_fdevopt+0x9d>
lea    0xef4(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
and    $0x4000,%rax
cmp    $0x0,%rax
je     11d7 <print_mm_fdevopt+0xc7>
lea    0xf29(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
jmp    11e5 <print_mm_fdevopt+0xd5>
lea    0xf5f(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
and    $0x10,%rax
cmp    $0x0,%rax
je     120d <print_mm_fdevopt+0xfd>
lea    0xf95(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
jmp    121b <print_mm_fdevopt+0x10b>
lea    0xfc8(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
and    $0x8,%rax
cmp    $0x0,%rax
je     1243 <print_mm_fdevopt+0x133>
lea    0xff7(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
jmp    1251 <print_mm_fdevopt+0x141>
lea    0x1015(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_mm_fdevopt>:
push   %rbx
mov    %rdi,%rbx
test   %rsi,%rsi
lea    0xee2(%rip),%rax
lea    0xef1(%rip),%rdi
cmove  %rax,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%esi
shr    $0x10,%esi
lea    0xef0(%rip),%rdi
call   1030 <printf@plt>
test   $0x8000,%ebx
jne    1154 <print_mm_fdevopt+0x44>
lea    0xf4a(%rip),%rdi
xor    %esi,%esi
jmp    1160 <print_mm_fdevopt+0x50>
lea    0xef2(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
test   $0x4000,%ebx
jne    1178 <print_mm_fdevopt+0x68>
lea    0xfc9(%rip),%rdi
xor    %esi,%esi
jmp    1184 <print_mm_fdevopt+0x74>
lea    0xf72(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
test   $0x10,%bl
jne    1199 <print_mm_fdevopt+0x89>
lea    0x1047(%rip),%rdi
xor    %esi,%esi
jmp    11a5 <print_mm_fdevopt+0x95>
lea    0xff3(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
test   $0x8,%bl
jne    11be <print_mm_fdevopt+0xae>
lea    0x10a9(%rip),%rdi
xor    %esi,%esi
pop    %rbx
jmp    1030 <printf@plt>
lea    0x1066(%rip),%rdi
mov    $0x8,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c" FDEVOPT = 0x%08X\0A\00"
@.str.1 = [22 x i8] c" AFDEVOPT = 0x%08X\0A\00"
@.str.2 = [33 x i8] c" 0x%04X USERID\0A\00"
@.str.3 = [77 x i8] c" %01x VBUSON pin: controlled by USB (GPM series only)\0A\00"
@.str.4 = [87 x i8] c" %01x VBUSON pin: controlled by port function (GPM series only)\0A\00"
@.str.5 = [76 x i8] c" %01x USBID pin: controlled by USB (GPM series only)\0A\00"
@.str.6 = [86 x i8] c" %01x USBID pin: controlled by port function (GPM series only)\0A\00"
@.str.7 = [73 x i8] c" %01x I2C1 is on pins RB8 & RB9 (GPM series only)\0A\00"
@.str.8 = [79 x i8] c" %01x I2C1 is on alt. pins, RB5 & RC9 (GPM series only)\0A\00"
@.str.9 = [52 x i8] c" %01x SOSC normal power mode\0A\00"
@.str.10 = [50 x i8] c" %01x SOSC High power mode\0A\00"
define void @print_mm_fdevopt(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, 4294901760
%18 = ashr i64 %17, 16
%19 = trunc i64 %18 to i32
%20 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %19)
%21 = load i64, i64* %3
%22 = and i64 %21, 32768
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %15
%25 = call i32 @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.3, i64 0, i64 0), i32 8)
br label %28
26: ; preds = %15
%27 = call i32 @printf(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.4, i64 0, i64 0), i32 0)
br label %28
28: ; preds = %26, %24
%29 = load i64, i64* %3
%30 = and i64 %29, 16384
%31 = icmp ne i64 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %28
%33 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.5, i64 0, i64 0), i32 4)
br label %36
34: ; preds = %28
%35 = call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.6, i64 0, i64 0), i32 0)
br label %36
36: ; preds = %34, %32
%37 = load i64, i64* %3
%38 = and i64 %37, 16
%39 = icmp ne i64 %38, 0
br i1 %39, label %40, label %42
40: ; preds = %36
%41 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.7, i64 0, i64 0), i32 1)
br label %44
42: ; preds = %36
%43 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.8, i64 0, i64 0), i32 0)
br label %44
44: ; preds = %42, %40
%45 = load i64, i64* %3
%46 = and i64 %45, 8
%47 = icmp ne i64 %46, 0
br i1 %47, label %48, label %50
48: ; preds = %44
%49 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.9, i64 0, i64 0), i32 8)
br label %52
50: ; preds = %44
%51 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.10, i64 0, i64 0), i32 0)
br label %52
52: ; preds = %50, %48
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c" FDEVOPT = 0x%08X\0A\00"
@.str.1 = [22 x i8] c" AFDEVOPT = 0x%08X\0A\00"
@.str.2 = [33 x i8] c" 0x%04X USERID\0A\00"
@.str.3 = [77 x i8] c" %01x VBUSON pin: controlled by USB (GPM series only)\0A\00"
@.str.4 = [87 x i8] c" %01x VBUSON pin: controlled by port function (GPM series only)\0A\00"
@.str.5 = [76 x i8] c" %01x USBID pin: controlled by USB (GPM series only)\0A\00"
@.str.6 = [86 x i8] c" %01x USBID pin: controlled by port function (GPM series only)\0A\00"
@.str.7 = [73 x i8] c" %01x I2C1 is on pins RB8 & RB9 (GPM series only)\0A\00"
@.str.8 = [79 x i8] c" %01x I2C1 is on alt. pins, RB5 & RC9 (GPM series only)\0A\00"
@.str.9 = [52 x i8] c" %01x SOSC normal power mode\0A\00"
@.str.10 = [50 x i8] c" %01x SOSC High power mode\0A\00"
define void @print_mm_fdevopt(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 = lshr i32 %4, 16
%8 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = and i64 %0, 32768
%10 = icmp eq i64 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = tail call i32 @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.3, i64 0, i64 0), i32 8)
br label %15
13: ; preds = %2
%14 = tail call i32 @printf(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.4, i64 0, i64 0), i32 0)
br label %15
15: ; preds = %13, %11
%16 = and i64 %0, 16384
%17 = icmp eq i64 %16, 0
br i1 %17, label %20, label %18
18: ; preds = %15
%19 = tail call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.5, i64 0, i64 0), i32 4)
br label %22
20: ; preds = %15
%21 = tail call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.6, i64 0, i64 0), i32 0)
br label %22
22: ; preds = %20, %18
%23 = and i64 %0, 16
%24 = icmp eq i64 %23, 0
br i1 %24, label %27, label %25
25: ; preds = %22
%26 = tail call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.7, i64 0, i64 0), i32 1)
br label %29
27: ; preds = %22
%28 = tail call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.8, i64 0, i64 0), i32 0)
br label %29
29: ; preds = %27, %25
%30 = and i64 %0, 8
%31 = icmp eq i64 %30, 0
br i1 %31, label %34, label %32
32: ; preds = %29
%33 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.9, i64 0, i64 0), i32 8)
br label %36
34: ; preds = %29
%35 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.10, i64 0, i64 0), i32 0)
br label %36
36: ; preds = %34, %32
ret void
}