#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*/ strchr(char *, char);
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ strcpymax(char *, char *, int);
int strlen(char *);
char *stripzone(char *date) {
  int num;
  static char tmpdate[80];
  if (!strcmp(date, "(no date)"))
    return (date);
  if (!strchr(date, ':'))
    return (date);
  strcpymax(tmpdate, date, 80);
  num = strlen(tmpdate);
  while (tmpdate[num] != ':')
    num--;
  num += 3;
  while (tmpdate[num])
    tmpdate[num++] = '\0';
  return (tmpdate);
}


x86 assembly (clang, -O0):
<stripzone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1172 <stripzone+0x32>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1227 <stripzone+0xe7>
mov    -0x10(%rbp),%rdi
mov    $0x3a,%esi
call   1040 <strchr@plt>
cmp    $0x0,%eax
jne    1196 <stripzone+0x56>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1227 <stripzone+0xe7>
mov    -0x10(%rbp),%rsi
lea    0x2eaf(%rip),%rdi
mov    $0x50,%edx
call   1060 <strcpymax@plt>
lea    0x2e9e(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rcx
lea    0x2e8b(%rip),%rax
movsbl (%rax,%rcx,1),%eax
cmp    $0x3a,%eax
je     11e0 <stripzone+0xa0>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    11ba <stripzone+0x7a>
mov    -0x14(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rcx
lea    0x2e5c(%rip),%rax
cmpb   $0x0,(%rax,%rcx,1)
je     121c <stripzone+0xdc>
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %eax,%rcx
lea    0x2e3d(%rip),%rax
movb   $0x0,(%rax,%rcx,1)
jmp    11e9 <stripzone+0xa9>
lea    0x2e2d(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stripzone>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xeb2(%rip),%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
je     11ff <stripzone+0xbf>
mov    %rbx,%rdi
mov    $0x3a,%esi
call   1040 <strchr@plt>
test   %eax,%eax
je     11ff <stripzone+0xbf>
lea    0x2ed9(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x50,%edx
call   1060 <strcpymax@plt>
mov    %r14,%rdi
call   1030 <strlen@plt>
movslq %eax,%rdx
lea    (%r14,%rdx,1),%rcx
shl    $0x20,%rdx
movabs $0x400000000,%rax
add    %rdx,%rax
movabs $0xffffffff00000000,%rdx
ff ff ff
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    %rdx,%rax
cmpb   $0x3a,(%rcx)
lea    -0x1(%rcx),%rcx
jne    11c0 <stripzone+0x80>
sar    $0x20,%rax
cmpb   $0x0,(%rax,%r14,1)
je     1202 <stripzone+0xc2>
lea    0x2e72(%rip),%r14
add    %r14,%rax
add    $0x1,%rax
cs nopw 0x0(%rax,%rax,1)
nop
movb   $0x0,-0x1(%rax)
cmpb   $0x0,(%rax)
lea    0x1(%rax),%rax
jne    11f0 <stripzone+0xb0>
jmp    1202 <stripzone+0xc2>
mov    %rbx,%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stripzone.tmpdate = internal global [80 x i8] zeroinitializer
@.str = [10 x i8] c"(no date)\00"
define i8* @stripzone(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @strcmp(i8* %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%7 = icmp ne i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = load i8*, i8** %3
store i8* %9, i8** %2
br label %45
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = call i32 @strchr(i8* %11, i8 signext 58)
%13 = icmp ne i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %10
%15 = load i8*, i8** %3
store i8* %15, i8** %2
br label %45
16: ; preds = %10
%17 = load i8*, i8** %3
%18 = call i32 @strcpymax(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @stripzone.tmpdate, i64 0, i64 0), i8* %17, i32 80)
%19 = call i32 @strlen(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @stripzone.tmpdate, i64 0, i64 0))
store i32 %19, i32* %4
br label %20
20: ; preds = %27, %16
%21 = load i32, i32* %4
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [80 x i8], [80 x i8]* @stripzone.tmpdate, i64 0, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp ne i32 %25, 58
br i1 %26, label %27, label %30
27: ; preds = %20
%28 = load i32, i32* %4
%29 = add nsw i32 %28, -1
store i32 %29, i32* %4
br label %20
30: ; preds = %20
%31 = load i32, i32* %4
%32 = add nsw i32 %31, 3
store i32 %32, i32* %4
br label %33
33: ; preds = %39, %30
%34 = load i32, i32* %4
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [80 x i8], [80 x i8]* @stripzone.tmpdate, i64 0, i64 %35
%37 = load i8, i8* %36
%38 = icmp ne i8 %37, 0
br i1 %38, label %39, label %44
39: ; preds = %33
%40 = load i32, i32* %4
%41 = add nsw i32 %40, 1
store i32 %41, i32* %4
%42 = sext i32 %40 to i64
%43 = getelementptr inbounds [80 x i8], [80 x i8]* @stripzone.tmpdate, i64 0, i64 %42
store i8 0, i8* %43
br label %33
44: ; preds = %33
store i8* getelementptr inbounds ([80 x i8], [80 x i8]* @stripzone.tmpdate, i64 0, i64 0), i8** %2
br label %45
45: ; preds = %44, %14, %8
%46 = load i8*, i8** %2
ret i8* %46
}

LLVM IR (-O2):
@stripzone.tmpdate = internal global [80 x i8] zeroinitializer
@.str = [10 x i8] c"(no date)\00"
define i8* @stripzone(i8* %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(10) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %31, label %4
4: ; preds = %1
%5 = tail call i32 @strchr(i8* %0, i8 signext 58)
%6 = icmp eq i32 %5, 0
br i1 %6, label %31, label %7
7: ; preds = %4
%8 = tail call i32 @strcpymax(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @stripzone.tmpdate, i64 0, i64 0), i8* %0, i32 80)
%9 = tail call i32 @strlen(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @stripzone.tmpdate, i64 0, i64 0))
%10 = sext i32 %9 to i64
br label %11
11: ; preds = %11, %7
%12 = phi i64 [ %16, %11 ], [ %10, %7 ]
%13 = getelementptr inbounds [80 x i8], [80 x i8]* @stripzone.tmpdate, i64 0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 58
%16 = add i64 %12, -1
br i1 %15, label %17, label %11
17: ; preds = %11
%18 = shl i64 %12, 32
%19 = add i64 %18, 12884901888
%20 = ashr exact i64 %19, 32
%21 = getelementptr inbounds [80 x i8], [80 x i8]* @stripzone.tmpdate, i64 0, i64 %20
%22 = load i8, i8* %21
%23 = icmp eq i8 %22, 0
br i1 %23, label %31, label %24
24: ; preds = %17, %24
%25 = phi i64 [ %27, %24 ], [ %20, %17 ]
%26 = phi i8* [ %28, %24 ], [ %21, %17 ]
%27 = add i64 %25, 1
store i8 0, i8* %26
%28 = getelementptr inbounds [80 x i8], [80 x i8]* @stripzone.tmpdate, i64 0, i64 %27
%29 = load i8, i8* %28
%30 = icmp eq i8 %29, 0
br i1 %30, label %31, label %24
31: ; preds = %24, %17, %4, %1
%32 = phi i8* [ %0, %1 ], [ %0, %4 ], [ getelementptr inbounds ([80 x i8], [80 x i8]* @stripzone.tmpdate, i64 0, i64 0), %17 ], [ getelementptr inbounds ([80 x i8], [80 x i8]* @stripzone.tmpdate, i64 0, i64 0), %24 ]
ret i8* %32
}