#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 */
unsigned char inb(int);
int /*<<< orphan*/ iopl(int);
int /*<<< orphan*/ outb(int, int);
int /*<<< orphan*/ printf(char *, unsigned char, unsigned char, unsigned char,
                          char, char, unsigned char, unsigned char,
                          unsigned char);
int main() {
  iopl(3);
  unsigned char ret, h, s, m, d, mo, r, dt;
  char den[2];
  outb(0xA, 0x74);
  ret = inb(0x75);
  while (ret & 0x80 == 1)
    ;
  outb(0x7, 0x74);
  d = inb(0x75);
  outb(0x8, 0x74);
  mo = inb(0x75);
  outb(0x9, 0x74);
  r = inb(0x75);
  outb(0x4, 0x74);
  h = inb(0x75);
  outb(0x2, 0x74);
  m = inb(0x75);
  outb(0x0, 0x74);
  s = inb(0x75);
  outb(0x6, 0x74);
  dt = inb(0x75);
  int idt = (int)dt;
  switch (idt) {
  case 7: {
    den[0] = 'N';
    den[1] = 'e';
    break;
  }
  case 1: {
    den[0] = 'P';
    den[1] = 'o';
    break;
  }
  case 2: {
    den[0] = 'U';
    den[1] = 't';
    break;
  }
  case 3: {
    den[0] = 'S';
    den[1] = 't';
    break;
  }
  case 4: {
    den[0] = 'C';
    den[1] = 't';
    break;
  }
  case 5: {
    den[0] = 'P';
    den[1] = 'a';
    break;
  }
  case 6: {
    den[0] = 'S';
    den[1] = 'o';
    break;
  }
  }
  if (s < 10) {
    printf("%x.%x.%x, %c%c %x:%x:0%x \n", d, mo, r, den[0], den[1], h, m, s);
  } else {
    printf("%x.%x.%x, %c%c %x:%x:%x \n", d, mo, r, den[0], den[1], h, m, s);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
call   1040 <iopl@plt>
mov    $0xa,%edi
mov    $0x74,%esi
call   1050 <outb@plt>
mov    $0x75,%edi
call   1060 <inb@plt>
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
and    $0x0,%eax
cmp    $0x0,%eax
je     118a <main+0x4a>
jmp    1175 <main+0x35>
mov    $0x7,%edi
mov    $0x74,%esi
mov    %esi,-0x28(%rbp)
call   1050 <outb@plt>
mov    $0x75,%edi
mov    %edi,-0x24(%rbp)
call   1060 <inb@plt>
mov    -0x28(%rbp),%esi
mov    %al,-0x9(%rbp)
mov    $0x8,%edi
call   1050 <outb@plt>
mov    -0x24(%rbp),%edi
call   1060 <inb@plt>
mov    -0x28(%rbp),%esi
mov    %al,-0xa(%rbp)
mov    $0x9,%edi
call   1050 <outb@plt>
mov    -0x24(%rbp),%edi
call   1060 <inb@plt>
mov    -0x28(%rbp),%esi
mov    %al,-0xb(%rbp)
mov    $0x4,%edi
call   1050 <outb@plt>
mov    -0x24(%rbp),%edi
call   1060 <inb@plt>
mov    -0x28(%rbp),%esi
mov    %al,-0x6(%rbp)
mov    $0x2,%edi
call   1050 <outb@plt>
mov    -0x24(%rbp),%edi
call   1060 <inb@plt>
mov    -0x28(%rbp),%esi
mov    %al,-0x8(%rbp)
xor    %edi,%edi
call   1050 <outb@plt>
mov    -0x24(%rbp),%edi
call   1060 <inb@plt>
mov    -0x28(%rbp),%esi
mov    %al,-0x7(%rbp)
mov    $0x6,%edi
call   1050 <outb@plt>
mov    -0x24(%rbp),%edi
call   1060 <inb@plt>
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x6,%eax
ja     12bf <main+0x17f>
mov    -0x20(%rbp),%rax
lea    0xda0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x4e,-0xe(%rbp)
movb   $0x65,-0xd(%rbp)
jmp    12bf <main+0x17f>
movb   $0x50,-0xe(%rbp)
movb   $0x6f,-0xd(%rbp)
jmp    12bf <main+0x17f>
movb   $0x55,-0xe(%rbp)
movb   $0x74,-0xd(%rbp)
jmp    12bf <main+0x17f>
movb   $0x53,-0xe(%rbp)
movb   $0x74,-0xd(%rbp)
jmp    12bf <main+0x17f>
movb   $0x43,-0xe(%rbp)
movb   $0x74,-0xd(%rbp)
jmp    12bf <main+0x17f>
movb   $0x50,-0xe(%rbp)
movb   $0x61,-0xd(%rbp)
jmp    12bf <main+0x17f>
movb   $0x53,-0xe(%rbp)
movb   $0x6f,-0xd(%rbp)
movzbl -0x7(%rbp),%eax
cmp    $0xa,%eax
jge    131f <main+0x1df>
mov    -0x9(%rbp),%sil
mov    -0xa(%rbp),%dl
mov    -0xb(%rbp),%cl
mov    -0xe(%rbp),%r8b
mov    -0xd(%rbp),%r9b
mov    -0x6(%rbp),%r10b
mov    -0x8(%rbp),%al
lea    0xd30(%rip),%rdi
movzbl %sil,%esi
movzbl %dl,%edx
movzbl %cl,%ecx
movsbl %r8b,%r8d
movsbl %r9b,%r9d
movzbl %r10b,%r10d
mov    %r10d,(%rsp)
movzbl %al,%eax
mov    %eax,0x8(%rsp)
movzbl -0x7(%rbp),%eax
mov    %eax,0x10(%rsp)
call   1030 <printf@plt>
jmp    136d <main+0x22d>
mov    -0x9(%rbp),%sil
mov    -0xa(%rbp),%dl
mov    -0xb(%rbp),%cl
mov    -0xe(%rbp),%r8b
mov    -0xd(%rbp),%r9b
mov    -0x6(%rbp),%r10b
mov    -0x8(%rbp),%al
lea    0xcf8(%rip),%rdi
movzbl %sil,%esi
movzbl %dl,%edx
movzbl %cl,%ecx
movsbl %r8b,%r8d
movsbl %r9b,%r9d
movzbl %r10b,%r10d
mov    %r10d,(%rsp)
movzbl %al,%eax
mov    %eax,0x8(%rsp)
movzbl -0x7(%rbp),%eax
mov    %eax,0x10(%rsp)
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x3,%edi
call   1040 <iopl@plt>
mov    $0xa,%edi
mov    $0x74,%esi
call   1050 <outb@plt>
mov    $0x75,%edi
call   1060 <inb@plt>
mov    $0x7,%edi
mov    $0x74,%esi
call   1050 <outb@plt>
mov    $0x75,%edi
call   1060 <inb@plt>
mov    %al,0x7(%rsp)
mov    $0x8,%edi
mov    $0x74,%esi
call   1050 <outb@plt>
mov    $0x75,%edi
call   1060 <inb@plt>
mov    %eax,%r14d
mov    $0x9,%edi
mov    $0x74,%esi
call   1050 <outb@plt>
mov    $0x75,%edi
call   1060 <inb@plt>
mov    %eax,%r15d
mov    $0x4,%edi
mov    $0x74,%esi
call   1050 <outb@plt>
mov    $0x75,%edi
call   1060 <inb@plt>
mov    %eax,%r12d
mov    $0x2,%edi
mov    $0x74,%esi
call   1050 <outb@plt>
mov    $0x75,%edi
call   1060 <inb@plt>
mov    %eax,%r13d
xor    %edi,%edi
mov    $0x74,%esi
call   1050 <outb@plt>
mov    $0x75,%edi
call   1060 <inb@plt>
mov    %eax,%ebx
mov    $0x6,%edi
mov    $0x74,%esi
call   1050 <outb@plt>
mov    $0x75,%edi
call   1060 <inb@plt>
add    $0xff,%al
cmp    $0x5,%al
ja     1254 <main+0x114>
movzbl %al,%ecx
shl    $0x3,%ecx
movabs $0x6f617474746f,%rax
shr    %cl,%rax
movabs $0x535043535550,%rbp
shr    %cl,%rbp
jmp    1259 <main+0x119>
mov    $0x4e,%bpl
mov    $0x65,%al
cmp    $0xa,%bl
lea    0xd9d(%rip),%rcx
lea    0xdb1(%rip),%rdi
cmovb  %rcx,%rdi
sub    $0x8,%rsp
movzbl %bl,%ebx
movzbl %r13b,%r10d
movzbl %r12b,%r11d
movzbl 0xf(%rsp),%esi
movzbl %r14b,%edx
movzbl %r15b,%ecx
movsbl %bpl,%r8d
movsbl %al,%r9d
push   %rbx
push   %r10
push   %r11
call   1030 <printf@plt>
add    $0x20,%rsp
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"%x.%x.%x, %c%c %x:%x:0%x \0A\00"
@.str.1 = [26 x i8] c"%x.%x.%x, %c%c %x:%x:%x \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca [2 x i8]
%11 = alloca i32
store i32 0, i32* %1
%12 = call i32 @iopl(i32 3)
%13 = call i32 @outb(i32 10, i32 116)
%14 = call zeroext i8 @inb(i32 117)
store i8 %14, i8* %2
br label %15
15: ; preds = %20, %0
%16 = load i8, i8* %2
%17 = zext i8 %16 to i32
%18 = and i32 %17, 0
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %15
br label %15
21: ; preds = %15
%22 = call i32 @outb(i32 7, i32 116)
%23 = call zeroext i8 @inb(i32 117)
store i8 %23, i8* %6
%24 = call i32 @outb(i32 8, i32 116)
%25 = call zeroext i8 @inb(i32 117)
store i8 %25, i8* %7
%26 = call i32 @outb(i32 9, i32 116)
%27 = call zeroext i8 @inb(i32 117)
store i8 %27, i8* %8
%28 = call i32 @outb(i32 4, i32 116)
%29 = call zeroext i8 @inb(i32 117)
store i8 %29, i8* %3
%30 = call i32 @outb(i32 2, i32 116)
%31 = call zeroext i8 @inb(i32 117)
store i8 %31, i8* %5
%32 = call i32 @outb(i32 0, i32 116)
%33 = call zeroext i8 @inb(i32 117)
store i8 %33, i8* %4
%34 = call i32 @outb(i32 6, i32 116)
%35 = call zeroext i8 @inb(i32 117)
store i8 %35, i8* %9
%36 = load i8, i8* %9
%37 = zext i8 %36 to i32
store i32 %37, i32* %11
%38 = load i32, i32* %11
switch i32 %38, label %60 [
i32 7, label %39
i32 1, label %42
i32 2, label %45
i32 3, label %48
i32 4, label %51
i32 5, label %54
i32 6, label %57
]
39: ; preds = %21
%40 = getelementptr inbounds [2 x i8], [2 x i8]* %10, i64 0, i64 0
store i8 78, i8* %40
%41 = getelementptr inbounds [2 x i8], [2 x i8]* %10, i64 0, i64 1
store i8 101, i8* %41
br label %60
42: ; preds = %21
%43 = getelementptr inbounds [2 x i8], [2 x i8]* %10, i64 0, i64 0
store i8 80, i8* %43
%44 = getelementptr inbounds [2 x i8], [2 x i8]* %10, i64 0, i64 1
store i8 111, i8* %44
br label %60
45: ; preds = %21
%46 = getelementptr inbounds [2 x i8], [2 x i8]* %10, i64 0, i64 0
store i8 85, i8* %46
%47 = getelementptr inbounds [2 x i8], [2 x i8]* %10, i64 0, i64 1
store i8 116, i8* %47
br label %60
48: ; preds = %21
%49 = getelementptr inbounds [2 x i8], [2 x i8]* %10, i64 0, i64 0
store i8 83, i8* %49
%50 = getelementptr inbounds [2 x i8], [2 x i8]* %10, i64 0, i64 1
store i8 116, i8* %50
br label %60
51: ; preds = %21
%52 = getelementptr inbounds [2 x i8], [2 x i8]* %10, i64 0, i64 0
store i8 67, i8* %52
%53 = getelementptr inbounds [2 x i8], [2 x i8]* %10, i64 0, i64 1
store i8 116, i8* %53
br label %60
54: ; preds = %21
%55 = getelementptr inbounds [2 x i8], [2 x i8]* %10, i64 0, i64 0
store i8 80, i8* %55
%56 = getelementptr inbounds [2 x i8], [2 x i8]* %10, i64 0, i64 1
store i8 97, i8* %56
br label %60
57: ; preds = %21
%58 = getelementptr inbounds [2 x i8], [2 x i8]* %10, i64 0, i64 0
store i8 83, i8* %58
%59 = getelementptr inbounds [2 x i8], [2 x i8]* %10, i64 0, i64 1
store i8 111, i8* %59
br label %60
60: ; preds = %21, %57, %54, %51, %48, %45, %42, %39
%61 = load i8, i8* %4
%62 = zext i8 %61 to i32
%63 = icmp slt i32 %62, 10
br i1 %63, label %64, label %76
64: ; preds = %60
%65 = load i8, i8* %6
%66 = load i8, i8* %7
%67 = load i8, i8* %8
%68 = getelementptr inbounds [2 x i8], [2 x i8]* %10, i64 0, i64 0
%69 = load i8, i8* %68
%70 = getelementptr inbounds [2 x i8], [2 x i8]* %10, i64 0, i64 1
%71 = load i8, i8* %70
%72 = load i8, i8* %3
%73 = load i8, i8* %5
%74 = load i8, i8* %4
%75 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8 zeroext %65, i8 zeroext %66, i8 zeroext %67, i8 signext %69, i8 signext %71, i8 zeroext %72, i8 zeroext %73, i8 zeroext %74)
br label %88
76: ; preds = %60
%77 = load i8, i8* %6
%78 = load i8, i8* %7
%79 = load i8, i8* %8
%80 = getelementptr inbounds [2 x i8], [2 x i8]* %10, i64 0, i64 0
%81 = load i8, i8* %80
%82 = getelementptr inbounds [2 x i8], [2 x i8]* %10, i64 0, i64 1
%83 = load i8, i8* %82
%84 = load i8, i8* %3
%85 = load i8, i8* %5
%86 = load i8, i8* %4
%87 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8 zeroext %77, i8 zeroext %78, i8 zeroext %79, i8 signext %81, i8 signext %83, i8 zeroext %84, i8 zeroext %85, i8 zeroext %86)
br label %88
88: ; preds = %76, %64
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"%x.%x.%x, %c%c %x:%x:0%x \0A\00"
@.str.1 = [26 x i8] c"%x.%x.%x, %c%c %x:%x:%x \0A\00"
define i32 @main() {
%1 = tail call i32 @iopl(i32 3)
%2 = tail call i32 @outb(i32 10, i32 116)
%3 = tail call zeroext i8 @inb(i32 117)
%4 = tail call i32 @outb(i32 7, i32 116)
%5 = tail call zeroext i8 @inb(i32 117)
%6 = tail call i32 @outb(i32 8, i32 116)
%7 = tail call zeroext i8 @inb(i32 117)
%8 = tail call i32 @outb(i32 9, i32 116)
%9 = tail call zeroext i8 @inb(i32 117)
%10 = tail call i32 @outb(i32 4, i32 116)
%11 = tail call zeroext i8 @inb(i32 117)
%12 = tail call i32 @outb(i32 2, i32 116)
%13 = tail call zeroext i8 @inb(i32 117)
%14 = tail call i32 @outb(i32 0, i32 116)
%15 = tail call zeroext i8 @inb(i32 117)
%16 = tail call i32 @outb(i32 6, i32 116)
%17 = tail call zeroext i8 @inb(i32 117)
%18 = add i8 %17, -1
%19 = icmp ult i8 %18, 6
br i1 %19, label %20, label %29
20: ; preds = %0
%21 = zext i8 %18 to i48
%22 = shl nuw nsw i48 %21, 3
%23 = lshr i48 122464356299887, %22
%24 = trunc i48 %23 to i8
%25 = zext i8 %18 to i48
%26 = shl nuw nsw i48 %25, 3
%27 = lshr i48 91604192023888, %26
%28 = trunc i48 %27 to i8
br label %29
29: ; preds = %20, %0
%30 = phi i8 [ 101, %0 ], [ %24, %20 ]
%31 = phi i8 [ 78, %0 ], [ %28, %20 ]
%32 = icmp ult i8 %15, 10
%33 = select i1 %32, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0)
%34 = tail call i32 @printf(i8* %33, i8 zeroext %5, i8 zeroext %7, i8 zeroext %9, i8 signext %31, i8 signext %30, i8 zeroext %11, i8 zeroext %13, i8 zeroext %15)
ret i32 0
}