#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 long ULONG_MAX;
unsigned long approxidate_careful(char const *, int *);
int /*<<< orphan*/ strcmp(char const *, char *);
int parse_expiry_date(const char *date, unsigned long *timestamp) {
  int errors = 0;
  if (!strcmp(date, "never") || !strcmp(date, "false"))
    *timestamp = 0;
  else if (!strcmp(date, "all") || !strcmp(date, "now"))
    *timestamp = ULONG_MAX;
  else
    *timestamp = approxidate_careful(date, &errors);
  return errors;
}


x86 assembly (clang, -O0):
<parse_expiry_date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xebe(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
je     1169 <parse_expiry_date+0x49>
mov    -0x8(%rbp),%rdi
lea    0xeab(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1179 <parse_expiry_date+0x59>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
jmp    11dd <parse_expiry_date+0xbd>
mov    -0x8(%rbp),%rdi
lea    0xe88(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
je     11ab <parse_expiry_date+0x8b>
mov    -0x8(%rbp),%rdi
lea    0xe73(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    11c1 <parse_expiry_date+0xa1>
mov    0x2e26(%rip),%rax
mov    (%rax),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    11d8 <parse_expiry_date+0xb8>
mov    -0x8(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <approxidate_careful@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    11dd <parse_expiry_date+0xbd>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_expiry_date>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movl   $0x0,0x4(%rsp)
lea    0xec7(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1191 <parse_expiry_date+0x71>
lea    0xebd(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1191 <parse_expiry_date+0x71>
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     119a <parse_expiry_date+0x7a>
lea    0xea1(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     119a <parse_expiry_date+0x7a>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <approxidate_careful@plt>
mov    %rax,(%r14)
mov    0x4(%rsp),%eax
jmp    11a9 <parse_expiry_date+0x89>
movq   $0x0,(%r14)
jmp    11a7 <parse_expiry_date+0x87>
mov    0x2e37(%rip),%rax
mov    (%rax),%rax
mov    %rax,(%r14)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"never\00"
@.str.1 = [6 x i8] c"false\00"
@.str.2 = [4 x i8] c"all\00"
@.str.3 = [4 x i8] c"now\00"
@ULONG_MAX = global i64 0
define i32 @parse_expiry_date(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
%5 = alloca i32
store i8* %0, i8** %3
store i64* %1, i64** %4
store i32 0, i32* %5
%6 = load i8*, i8** %3
%7 = call i32 @strcmp(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = call i32 @strcmp(i8* %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp ne i32 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %9, %2
%14 = load i64*, i64** %4
store i64 0, i64* %14
br label %31
15: ; preds = %9
%16 = load i8*, i8** %3
%17 = call i32 @strcmp(i8* %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %15
%20 = load i8*, i8** %3
%21 = call i32 @strcmp(i8* %20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%22 = icmp ne i32 %21, 0
br i1 %22, label %26, label %23
23: ; preds = %19, %15
%24 = load i64, i64* @ULONG_MAX
%25 = load i64*, i64** %4
store i64 %24, i64* %25
br label %30
26: ; preds = %19
%27 = load i8*, i8** %3
%28 = call i64 @approxidate_careful(i8* %27, i32* %5)
%29 = load i64*, i64** %4
store i64 %28, i64* %29
br label %30
30: ; preds = %26, %23
br label %31
31: ; preds = %30, %13
%32 = load i32, i32* %5
ret i32 %32
}

LLVM IR (-O2):
@.str = [6 x i8] c"never\00"
@.str.1 = [6 x i8] c"false\00"
@.str.2 = [4 x i8] c"all\00"
@.str.3 = [4 x i8] c"now\00"
@ULONG_MAX = global i64 0
define i32 @parse_expiry_date(i8* %0, i64* nocapture writeonly %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7, %2
store i64 0, i64* %1
br label %22
11: ; preds = %7
%12 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%13 = icmp eq i32 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %11
%15 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %14, %11
%18 = load i64, i64* @ULONG_MAX
store i64 %18, i64* %1
br label %22
19: ; preds = %14
%20 = call i64 @approxidate_careful(i8* %0, i32* %3)
store i64 %20, i64* %1
%21 = load i32, i32* %3
br label %22
22: ; preds = %17, %19, %10
%23 = phi i32 [ 0, %17 ], [ %21, %19 ], [ 0, %10 ]
ret i32 %23
}