#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*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char const *const);
int strlen(char const *const);
char *show_time(const char *const input) {
  static char output[16];
  switch (strlen(input)) {
  case 1:
    if (input[0] == 'H')
      strcpy(output, "&half;");
    else
      strcpy(output, input);
    break;
  case 2:
    strcpy(output, input);
    if (output[1] == 'H') {
      strcpy(output + 1, "&half;");
    }
    break;
  case 4:
  case 5:
    output[0] = input[0];
    output[1] = input[1];
    output[2] = ':';
    output[3] = input[2];
    output[4] = input[3];
    output[5] = '\0';
    if (input[4] == 'H') {
      strcat(output, "&half;");
    }
    break;
  default:
    strcpy(output, input);
    break;
  }
  return output;
}


x86 assembly (clang, -O0):
<show_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    %ecx,-0xc(%rbp)
sub    $0x1,%eax
je     117d <show_time+0x4d>
jmp    1158 <show_time+0x28>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     11ba <show_time+0x8a>
jmp    1169 <show_time+0x39>
mov    -0xc(%rbp),%eax
add    $0xfffffffc,%eax
sub    $0x2,%eax
jb     11f2 <show_time+0xc2>
jmp    125c <show_time+0x12c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x48,%eax
jne    11a5 <show_time+0x75>
lea    0x2ebc(%rip),%rdi
lea    0xe65(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11b5 <show_time+0x85>
mov    -0x8(%rbp),%rsi
lea    0x2ea0(%rip),%rdi
call   1030 <strcpy@plt>
jmp    126c <show_time+0x13c>
mov    -0x8(%rbp),%rsi
lea    0x2e8b(%rip),%rdi
call   1030 <strcpy@plt>
movsbl 0x2e80(%rip),%eax
cmp    $0x48,%eax
jne    11ed <show_time+0xbd>
lea    0x2e70(%rip),%rdi
lea    0xe18(%rip),%rsi
call   1030 <strcpy@plt>
jmp    126c <show_time+0x13c>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,0x2e52(%rip)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,0x2e46(%rip)
movb   $0x3a,0x2e40(%rip)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%al
mov    %al,0x2e34(%rip)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%al
mov    %al,0x2e28(%rip)
movb   $0x0,0x2e22(%rip)
mov    -0x8(%rbp),%rax
movsbl 0x4(%rax),%eax
cmp    $0x48,%eax
jne    1257 <show_time+0x127>
lea    0x2e05(%rip),%rdi
lea    0xdae(%rip),%rsi
call   1050 <strcat@plt>
jmp    126c <show_time+0x13c>
mov    -0x8(%rbp),%rsi
lea    0x2de9(%rip),%rdi
call   1030 <strcpy@plt>
lea    0x2ddd(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_time>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    -0x4(%rax),%ecx
cmp    $0x2,%ecx
jb     1159 <show_time+0x29>
cmp    $0x2,%eax
je     11b1 <show_time+0x81>
cmp    $0x1,%eax
jne    11a5 <show_time+0x75>
cmpb   $0x48,(%rbx)
jne    11a5 <show_time+0x75>
lea    0x2ef9(%rip),%rdi
jmp    11d0 <show_time+0xa0>
mov    (%rbx),%al
mov    %al,0x2eef(%rip)
mov    0x1(%rbx),%al
mov    %al,0x2ee7(%rip)
movb   $0x3a,0x2ee1(%rip)
mov    0x2(%rbx),%al
mov    %al,0x2ed9(%rip)
mov    0x3(%rbx),%al
mov    %al,0x2ed1(%rip)
movb   $0x0,0x2ecb(%rip)
cmpb   $0x48,0x4(%rbx)
jne    11dc <show_time+0xac>
lea    0x2eb9(%rip),%rdi
lea    0xe62(%rip),%rsi
call   1050 <strcat@plt>
jmp    11dc <show_time+0xac>
lea    0x2ea4(%rip),%rdi
mov    %rbx,%rsi
jmp    11d7 <show_time+0xa7>
lea    0x2e98(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
cmpb   $0x48,0x2e8a(%rip)
jne    11dc <show_time+0xac>
lea    0x2e81(%rip),%rdi
lea    0xe29(%rip),%rsi
call   1030 <strcpy@plt>
lea    0x2e6d(%rip),%rax
pop    %rbx
ret

LLVM IR (-O0):
@show_time.output = internal global [16 x i8] zeroinitializer
@.str = [7 x i8] c"&half;\00"
define i8* @show_time(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strlen(i8* %3)
switch i32 %4, label %47 [
i32 1, label %5
i32 2, label %17
i32 4, label %26
i32 5, label %26
]
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 72
br i1 %10, label %11, label %13
11: ; preds = %5
%12 = call i32 @strcpy(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @show_time.output, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %16
13: ; preds = %5
%14 = load i8*, i8** %2
%15 = call i32 @strcpy(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @show_time.output, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %13, %11
br label %50
17: ; preds = %1
%18 = load i8*, i8** %2
%19 = call i32 @strcpy(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @show_time.output, i64 0, i64 0), i8* %18)
%20 = load i8, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @show_time.output, i64 0, i64 1)
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 72
br i1 %22, label %23, label %25
23: ; preds = %17
%24 = call i32 @strcpy(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @show_time.output, i64 0, i64 1), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %25
25: ; preds = %23, %17
br label %50
26: ; preds = %1, %1
%27 = load i8*, i8** %2
%28 = getelementptr inbounds i8, i8* %27, i64 0
%29 = load i8, i8* %28
store i8 %29, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @show_time.output, i64 0, i64 0)
%30 = load i8*, i8** %2
%31 = getelementptr inbounds i8, i8* %30, i64 1
%32 = load i8, i8* %31
store i8 %32, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @show_time.output, i64 0, i64 1)
store i8 58, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @show_time.output, i64 0, i64 2)
%33 = load i8*, i8** %2
%34 = getelementptr inbounds i8, i8* %33, i64 2
%35 = load i8, i8* %34
store i8 %35, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @show_time.output, i64 0, i64 3)
%36 = load i8*, i8** %2
%37 = getelementptr inbounds i8, i8* %36, i64 3
%38 = load i8, i8* %37
store i8 %38, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @show_time.output, i64 0, i64 4)
store i8 0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @show_time.output, i64 0, i64 5)
%39 = load i8*, i8** %2
%40 = getelementptr inbounds i8, i8* %39, i64 4
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = icmp eq i32 %42, 72
br i1 %43, label %44, label %46
44: ; preds = %26
%45 = call i32 @strcat(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @show_time.output, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %46
46: ; preds = %44, %26
br label %50
47: ; preds = %1
%48 = load i8*, i8** %2
%49 = call i32 @strcpy(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @show_time.output, i64 0, i64 0), i8* %48)
br label %50
50: ; preds = %47, %46, %25, %16
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @show_time.output, i64 0, i64 0)
}

LLVM IR (-O2):
@show_time.output = internal global [16 x i8] zeroinitializer
@.str = [7 x i8] c"&half;\00"
define i8* @show_time(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
switch i32 %2, label %29 [
i32 1, label %3
i32 2, label %10
i32 4, label %16
i32 5, label %16
]
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 72
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @strcpy(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @show_time.output, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %31
8: ; preds = %3
%9 = tail call i32 @strcpy(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @show_time.output, i64 0, i64 0), i8* %0)
br label %31
10: ; preds = %1
%11 = tail call i32 @strcpy(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @show_time.output, i64 0, i64 0), i8* %0)
%12 = load i8, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @show_time.output, i64 0, i64 1)
%13 = icmp eq i8 %12, 72
br i1 %13, label %14, label %31
14: ; preds = %10
%15 = tail call i32 @strcpy(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @show_time.output, i64 0, i64 1), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %31
16: ; preds = %1, %1
%17 = load i8, i8* %0
store i8 %17, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @show_time.output, i64 0, i64 0)
%18 = getelementptr inbounds i8, i8* %0, i64 1
%19 = load i8, i8* %18
store i8 %19, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @show_time.output, i64 0, i64 1)
store i8 58, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @show_time.output, i64 0, i64 2)
%20 = getelementptr inbounds i8, i8* %0, i64 2
%21 = load i8, i8* %20
store i8 %21, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @show_time.output, i64 0, i64 3)
%22 = getelementptr inbounds i8, i8* %0, i64 3
%23 = load i8, i8* %22
store i8 %23, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @show_time.output, i64 0, i64 4)
store i8 0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @show_time.output, i64 0, i64 5)
%24 = getelementptr inbounds i8, i8* %0, i64 4
%25 = load i8, i8* %24
%26 = icmp eq i8 %25, 72
br i1 %26, label %27, label %31
27: ; preds = %16
%28 = tail call i32 @strcat(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @show_time.output, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %31
29: ; preds = %1
%30 = tail call i32 @strcpy(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @show_time.output, i64 0, i64 0), i8* %0)
br label %31
31: ; preds = %16, %27, %10, %14, %6, %8, %29
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @show_time.output, i64 0, i64 0)
}