#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 */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void dump_pil(int pil) {
  int day, mon, hour, min;
  day = pil >> 15;
  mon = (pil >> 11) & 0xF;
  hour = (pil >> 6) & 0x1F;
  min = pil & 0x3F;
  if (pil == (((0) << 15) + ((15) << 11) + ((31) << 6) + ((63) << 0)))
    printf(" PDC: Timer-control (no PDC)\n");
  else if (pil == (((0) << 15) + ((15) << 11) + ((30) << 6) + ((63) << 0)))
    printf(" PDC: Recording inhibit/terminate\n");
  else if (pil == (((0) << 15) + ((15) << 11) + ((29) << 6) + ((63) << 0)))
    printf(" PDC: Interruption\n");
  else if (pil == (((0) << 15) + ((15) << 11) + ((28) << 6) + ((63) << 0)))
    printf(" PDC: Continue\n");
  else if (pil == (((31) << 15) + ((15) << 11) + ((31) << 6) + ((63) << 0)))
    printf(" PDC: No time\n");
  else
    printf(" PDC: %05x, 200X-%02d-%02d %02d:%02d\n", pil, mon, day, hour, min);
}


x86 assembly (clang, -O0):
<dump_pil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xf,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xb,%eax
and    $0xf,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x6,%eax
and    $0x1f,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3f,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x7fff,-0x4(%rbp)
jne    1165 <dump_pil+0x55>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1218 <dump_pil+0x108>
cmpl   $0x7fbf,-0x4(%rbp)
jne    1185 <dump_pil+0x75>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1213 <dump_pil+0x103>
cmpl   $0x7f7f,-0x4(%rbp)
jne    11a5 <dump_pil+0x95>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    120e <dump_pil+0xfe>
cmpl   $0x7f3f,-0x4(%rbp)
jne    11c5 <dump_pil+0xb5>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1209 <dump_pil+0xf9>
cmpl   $0xfffff,-0x4(%rbp)
jne    11e5 <dump_pil+0xd5>
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1204 <dump_pil+0xf4>
mov    -0x4(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r9d
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1209 <dump_pil+0xf9>
jmp    120e <dump_pil+0xfe>
jmp    1213 <dump_pil+0x103>
jmp    1218 <dump_pil+0x108>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_pil>:
mov    %edi,%esi
cmp    $0x7fbe,%edi
jle    114e <dump_pil+0x2e>
cmp    $0x7fbf,%esi
je     116a <dump_pil+0x4a>
cmp    $0xfffff,%esi
je     1176 <dump_pil+0x56>
cmp    $0x7fff,%esi
jne    118e <dump_pil+0x6e>
lea    0xf2f(%rip),%rdi
jmp    1030 <puts@plt>
cmp    $0x7f3f,%esi
je     1182 <dump_pil+0x62>
cmp    $0x7f7f,%esi
jne    118e <dump_pil+0x6e>
lea    0xede(%rip),%rdi
jmp    1030 <puts@plt>
lea    0xee5(%rip),%rdi
jmp    1030 <puts@plt>
lea    0xea9(%rip),%rdi
jmp    1030 <puts@plt>
lea    0xeab(%rip),%rdi
jmp    1030 <puts@plt>
mov    %esi,%r9d
and    $0x3f,%r9d
mov    %esi,%r8d
shr    $0x6,%r8d
and    $0x1f,%r8d
mov    %esi,%edx
shr    $0xb,%edx
and    $0xf,%edx
mov    %esi,%ecx
sar    $0xf,%ecx
lea    0xe4c(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [30 x i8] c" PDC: Timer-control (no PDC)\0A\00"
@.str.1 = [35 x i8] c" PDC: Recording inhibit/terminate\0A\00"
@.str.2 = [20 x i8] c" PDC: Interruption\0A\00"
@.str.3 = [16 x i8] c" PDC: Continue\0A\00"
@.str.4 = [15 x i8] c" PDC: No time\0A\00"
@.str.5 = [38 x i8] c" PDC: %05x, 200X-%02d-%02d %02d:%02d\0A\00"
define void @dump_pil(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
%7 = load i32, i32* %2
%8 = ashr i32 %7, 15
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = ashr i32 %9, 11
%11 = and i32 %10, 15
store i32 %11, i32* %4
%12 = load i32, i32* %2
%13 = ashr i32 %12, 6
%14 = and i32 %13, 31
store i32 %14, i32* %5
%15 = load i32, i32* %2
%16 = and i32 %15, 63
store i32 %16, i32* %6
%17 = load i32, i32* %2
%18 = icmp eq i32 %17, 32767
br i1 %18, label %19, label %21
19: ; preds = %1
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %52
21: ; preds = %1
%22 = load i32, i32* %2
%23 = icmp eq i32 %22, 32703
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
br label %51
26: ; preds = %21
%27 = load i32, i32* %2
%28 = icmp eq i32 %27, 32639
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %50
31: ; preds = %26
%32 = load i32, i32* %2
%33 = icmp eq i32 %32, 32575
br i1 %33, label %34, label %36
34: ; preds = %31
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
br label %49
36: ; preds = %31
%37 = load i32, i32* %2
%38 = icmp eq i32 %37, 1048575
br i1 %38, label %39, label %41
39: ; preds = %36
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
br label %48
41: ; preds = %36
%42 = load i32, i32* %2
%43 = load i32, i32* %4
%44 = load i32, i32* %3
%45 = load i32, i32* %5
%46 = load i32, i32* %6
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0), i32 %42, i32 %43, i32 %44, i32 %45, i32 %46)
br label %48
48: ; preds = %41, %39
br label %49
49: ; preds = %48, %34
br label %50
50: ; preds = %49, %29
br label %51
51: ; preds = %50, %24
br label %52
52: ; preds = %51, %19
ret void
}

LLVM IR (-O2):
@.str.5 = [38 x i8] c" PDC: %05x, 200X-%02d-%02d %02d:%02d\0A\00"
@str = [14 x i8] c" PDC: No time\00"
@str.6 = [15 x i8] c" PDC: Continue\00"
@str.7 = [19 x i8] c" PDC: Interruption\00"
@str.8 = [34 x i8] c" PDC: Recording inhibit/terminate\00"
@str.9 = [29 x i8] c" PDC: Timer-control (no PDC)\00"
define void @dump_pil(i32 %0) {
switch i32 %0, label %12 [
i32 32767, label %2
i32 32703, label %4
i32 32639, label %6
i32 32575, label %8
i32 1048575, label %10
]
2: ; preds = %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.9, i64 0, i64 0))
br label %20
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.8, i64 0, i64 0))
br label %20
6: ; preds = %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.7, i64 0, i64 0))
br label %20
8: ; preds = %1
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.6, i64 0, i64 0))
br label %20
10: ; preds = %1
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
br label %20
12: ; preds = %1
%13 = and i32 %0, 63
%14 = lshr i32 %0, 6
%15 = and i32 %14, 31
%16 = lshr i32 %0, 11
%17 = and i32 %16, 15
%18 = ashr i32 %0, 15
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0), i32 %0, i32 %17, i32 %18, i32 %15, i32 %13)
br label %20
20: ; preds = %4, %8, %12, %10, %6, %2
ret void
}