#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 *, char, char, char, char, char, char, char,
                          char);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char time[11];
  scanf("%s", time);
  if ((time[8] == 'P' || time[8] == 'p') &&
      !(time[0] == '1' && time[1] == '2')) {
    time[0] = time[0] + 1;
    time[1] = time[1] + 2;
  } else if (time[0] == '1' && time[1] == '2' &&
             (time[8] == 'a' || time[8] == 'A')) {
    time[0] = time[1] = '0';
  }
  printf("%c%c%c%c%c%c%c%c", time[0], time[1], time[2], time[3], time[4],
         time[5], time[6], time[7]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xf(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1040 <scanf@plt>
movsbl -0x7(%rbp),%eax
cmp    $0x50,%eax
je     1159 <main+0x39>
movsbl -0x7(%rbp),%eax
cmp    $0x70,%eax
jne    118c <main+0x6c>
movsbl -0xf(%rbp),%eax
cmp    $0x31,%eax
jne    1173 <main+0x53>
movsbl -0xe(%rbp),%eax
cmp    $0x32,%eax
je     118c <main+0x6c>
movsbl -0xf(%rbp),%eax
add    $0x1,%eax
mov    %al,-0xf(%rbp)
movsbl -0xe(%rbp),%eax
add    $0x2,%eax
mov    %al,-0xe(%rbp)
jmp    11cd <main+0xad>
movsbl -0xf(%rbp),%eax
cmp    $0x31,%eax
jne    11c8 <main+0xa8>
movsbl -0xe(%rbp),%eax
cmp    $0x32,%eax
jne    11c8 <main+0xa8>
movsbl -0x7(%rbp),%eax
cmp    $0x61,%eax
je     11c0 <main+0xa0>
movsbl -0x7(%rbp),%eax
cmp    $0x41,%eax
jne    11c8 <main+0xa8>
movb   $0x30,-0xe(%rbp)
movb   $0x30,-0xf(%rbp)
jmp    11cd <main+0xad>
mov    -0xf(%rbp),%sil
mov    -0xe(%rbp),%dl
mov    -0xd(%rbp),%cl
mov    -0xc(%rbp),%r8b
mov    -0xb(%rbp),%r9b
mov    -0xa(%rbp),%r10b
mov    -0x9(%rbp),%al
lea    0xe16(%rip),%rdi
movsbl %sil,%esi
movsbl %dl,%edx
movsbl %cl,%ecx
movsbl %r8b,%r8d
movsbl %r9b,%r9d
movsbl %r10b,%r10d
mov    %r10d,(%rsp)
movsbl %al,%eax
mov    %eax,0x8(%rsp)
movsbl -0x8(%rbp),%eax
mov    %eax,0x10(%rsp)
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0xd(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x15(%rsp),%cl
and    $0xdf,%cl
mov    0xd(%rsp),%sil
mov    0xe(%rsp),%dil
mov    %esi,%eax
xor    $0x31,%al
mov    %edi,%edx
xor    $0x32,%dl
or     %al,%dl
sete   %al
cmp    $0x50,%cl
jne    1165 <main+0x45>
test   %al,%al
je     1180 <main+0x60>
mov    $0x31,%sil
mov    $0x32,%dil
jmp    1192 <main+0x72>
cmp    $0x41,%cl
sete   %cl
and    %cl,%al
cmp    $0x1,%al
jne    1192 <main+0x72>
movw   $0x3030,0xd(%rsp)
mov    $0x30,%dil
mov    $0x30,%sil
jmp    1192 <main+0x72>
add    $0x1,%sil
mov    %sil,0xd(%rsp)
add    $0x2,%dil
mov    %dil,0xe(%rsp)
movsbl 0xf(%rsp),%ecx
movsbl 0x10(%rsp),%r8d
movsbl 0x11(%rsp),%r9d
movsbl 0x12(%rsp),%r10d
movsbl 0x13(%rsp),%r11d
movsbl 0x14(%rsp),%eax
sub    $0x8,%rsp
movsbl %sil,%esi
movsbl %dil,%edx
lea    0xe3c(%rip),%rdi
push   %rax
push   %r11
push   %r10
call   1030 <printf@plt>
add    $0x20,%rsp
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [17 x i8] c"%c%c%c%c%c%c%c%c\00"
define i32 @main() {
%1 = alloca [11 x i8]
%2 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 8
%5 = load i8, i8* %4
%6 = and i8 %5, -33
%7 = icmp eq i8 %6, 80
%8 = load i8, i8* %2
%9 = icmp eq i8 %8, 49
%10 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 50
%13 = select i1 %9, i1 %12, i1 false
br i1 %7, label %14, label %18
14: ; preds = %0
br i1 %13, label %22, label %15
15: ; preds = %14
%16 = add i8 %8, 1
store i8 %16, i8* %2
%17 = add i8 %11, 2
store i8 %17, i8* %10
br label %22
18: ; preds = %0
%19 = icmp eq i8 %6, 65
%20 = select i1 %13, i1 %19, i1 false
br i1 %20, label %21, label %22
21: ; preds = %18
store i8 48, i8* %10
store i8 48, i8* %2
br label %22
22: ; preds = %14, %18, %21, %15
%23 = phi i8 [ 50, %14 ], [ %11, %18 ], [ 48, %21 ], [ %17, %15 ]
%24 = phi i8 [ 49, %14 ], [ %8, %18 ], [ 48, %21 ], [ %16, %15 ]
%25 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 2
%26 = load i8, i8* %25
%27 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 3
%28 = load i8, i8* %27
%29 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 4
%30 = load i8, i8* %29
%31 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 5
%32 = load i8, i8* %31
%33 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 6
%34 = load i8, i8* %33
%35 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 7
%36 = load i8, i8* %35
%37 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8 signext %24, i8 signext %23, i8 signext %26, i8 signext %28, i8 signext %30, i8 signext %32, i8 signext %34, i8 signext %36)
ret i32 0
}