#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*/ assert(int);
scalar_t__ is_date(char *, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int test_is_date() {
  char str[20], date_format[20];
  printf("test_is_date...");
  sprintf(date_format, "%s", "%d/%m/%Y");
  sprintf(str, "%s", "$123");
  assert(is_date(str, date_format) == 0);
  sprintf(str, "%s", "02/05/2016");
  assert(is_date(str, date_format) != 0);
  sprintf(str, "%s", "17/13/2018");
  assert(is_date(str, date_format) == 0);
  sprintf(str, "%s", "2008/21/24");
  assert(is_date(str, date_format) == 0);
  sprintf(date_format, "%s", "%m/%d/%Y");
  sprintf(str, "%s", "02/09/2014");
  assert(is_date(str, date_format) != 0);
  sprintf(str, "%s", "15/09/2014");
  assert(is_date(str, date_format) == 0);
  sprintf(str, "%s", "02/07/20");
  assert(is_date(str, date_format) == 0);
  sprintf(str, "%s", "02/09/5123");
  assert(is_date(str, date_format) == 0);
  printf("ok\n");
  return 1;
}


x86 assembly (clang, -O0):
<test_is_date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
lea    0xeb1(%rip),%rsi
lea    0xead(%rip),%rdx
call   1060 <sprintf@plt>
lea    -0x20(%rbp),%rdi
lea    0xe9a(%rip),%rsi
lea    0xe9f(%rip),%rdx
call   1060 <sprintf@plt>
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1050 <is_date@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x20(%rbp),%rdi
lea    0xe65(%rip),%rsi
lea    0xe6f(%rip),%rdx
call   1060 <sprintf@plt>
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1050 <is_date@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x20(%rbp),%rdi
lea    0xe30(%rip),%rsi
lea    0xe45(%rip),%rdx
call   1060 <sprintf@plt>
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1050 <is_date@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x20(%rbp),%rdi
lea    0xdfb(%rip),%rsi
lea    0xe1b(%rip),%rdx
call   1060 <sprintf@plt>
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1050 <is_date@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x40(%rbp),%rdi
lea    0xdc6(%rip),%rsi
lea    0xdf1(%rip),%rdx
call   1060 <sprintf@plt>
lea    -0x20(%rbp),%rdi
lea    0xdaf(%rip),%rsi
lea    0xde3(%rip),%rdx
call   1060 <sprintf@plt>
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1050 <is_date@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x20(%rbp),%rdi
lea    0xd7a(%rip),%rsi
lea    0xdb9(%rip),%rdx
call   1060 <sprintf@plt>
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1050 <is_date@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x20(%rbp),%rdi
lea    0xd45(%rip),%rsi
lea    0xd8f(%rip),%rdx
call   1060 <sprintf@plt>
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1050 <is_date@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x20(%rbp),%rdi
lea    0xd10(%rip),%rsi
lea    0xd63(%rip),%rdx
call   1060 <sprintf@plt>
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1050 <is_date@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xd44(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_is_date>:
push   %r14
push   %rbx
sub    $0x38,%rsp
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
movabs $0x59252f6d252f6425,%rax
2f 25 59
mov    %rax,0x20(%rsp)
movb   $0x0,0x28(%rsp)
movl   $0x33323124,(%rsp)
movb   $0x0,0x4(%rsp)
mov    %rsp,%rbx
lea    0x20(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <is_date@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1050 <assert@plt>
movabs $0x30322f35302f3230,%rax
2f 32 30
mov    %rax,(%rsp)
movl   $0x363130,0x7(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <is_date@plt>
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1050 <assert@plt>
movabs $0x30322f33312f3731,%rax
2f 32 30
mov    %rax,(%rsp)
movl   $0x383130,0x7(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <is_date@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1050 <assert@plt>
movabs $0x2f31322f38303032,%rax
32 31 2f
mov    %rax,(%rsp)
movl   $0x34322f,0x7(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <is_date@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1050 <assert@plt>
movabs $0x59252f64252f6d25,%rax
2f 25 59
mov    %rax,0x20(%rsp)
movb   $0x0,0x28(%rsp)
movabs $0x30322f39302f3230,%rax
2f 32 30
mov    %rax,(%rsp)
movl   $0x343130,0x7(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <is_date@plt>
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1050 <assert@plt>
movabs $0x30322f39302f3531,%rax
2f 32 30
mov    %rax,(%rsp)
movl   $0x343130,0x7(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <is_date@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1050 <assert@plt>
movabs $0x30322f37302f3230,%rax
2f 32 30
mov    %rax,(%rsp)
movb   $0x0,0x8(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <is_date@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1050 <assert@plt>
movabs $0x31352f39302f3230,%rax
2f 35 31
mov    %rax,(%rsp)
movl   $0x333231,0x7(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <is_date@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1050 <assert@plt>
lea    0xd7d(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [16 x i8] c"test_is_date...\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [9 x i8] c"%d/%m/%Y\00"
@.str.3 = [5 x i8] c"$123\00"
@.str.4 = [11 x i8] c"02/05/2016\00"
@.str.5 = [11 x i8] c"17/13/2018\00"
@.str.6 = [11 x i8] c"2008/21/24\00"
@.str.7 = [9 x i8] c"%m/%d/%Y\00"
@.str.8 = [11 x i8] c"02/09/2014\00"
@.str.9 = [11 x i8] c"15/09/2014\00"
@.str.10 = [9 x i8] c"02/07/20\00"
@.str.11 = [11 x i8] c"02/09/5123\00"
@.str.12 = [4 x i8] c"ok\0A\00"
define i32 @test_is_date() {
%1 = alloca [20 x i8]
%2 = alloca [20 x i8]
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%7 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%10 = call i64 @is_date(i8* %8, i8* %9)
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%15 = call i32 @sprintf(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%16 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%17 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%18 = call i64 @is_date(i8* %16, i8* %17)
%19 = icmp ne i64 %18, 0
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
%22 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%23 = call i32 @sprintf(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%24 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%25 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%26 = call i64 @is_date(i8* %24, i8* %25)
%27 = icmp eq i64 %26, 0
%28 = zext i1 %27 to i32
%29 = call i32 @assert(i32 %28)
%30 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%31 = call i32 @sprintf(i8* %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%32 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%33 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%34 = call i64 @is_date(i8* %32, i8* %33)
%35 = icmp eq i64 %34, 0
%36 = zext i1 %35 to i32
%37 = call i32 @assert(i32 %36)
%38 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%39 = call i32 @sprintf(i8* %38, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%40 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%41 = call i32 @sprintf(i8* %40, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
%42 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%43 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%44 = call i64 @is_date(i8* %42, i8* %43)
%45 = icmp ne i64 %44, 0
%46 = zext i1 %45 to i32
%47 = call i32 @assert(i32 %46)
%48 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%49 = call i32 @sprintf(i8* %48, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0))
%50 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%51 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%52 = call i64 @is_date(i8* %50, i8* %51)
%53 = icmp eq i64 %52, 0
%54 = zext i1 %53 to i32
%55 = call i32 @assert(i32 %54)
%56 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%57 = call i32 @sprintf(i8* %56, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%58 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%59 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%60 = call i64 @is_date(i8* %58, i8* %59)
%61 = icmp eq i64 %60, 0
%62 = zext i1 %61 to i32
%63 = call i32 @assert(i32 %62)
%64 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%65 = call i32 @sprintf(i8* %64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0))
%66 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%67 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%68 = call i64 @is_date(i8* %66, i8* %67)
%69 = icmp eq i64 %68, 0
%70 = zext i1 %69 to i32
%71 = call i32 @assert(i32 %70)
%72 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [16 x i8] c"test_is_date...\00"
@.str.2 = [9 x i8] c"%d/%m/%Y\00"
@.str.3 = [5 x i8] c"$123\00"
@.str.4 = [11 x i8] c"02/05/2016\00"
@.str.5 = [11 x i8] c"17/13/2018\00"
@.str.6 = [11 x i8] c"2008/21/24\00"
@.str.7 = [9 x i8] c"%m/%d/%Y\00"
@.str.8 = [11 x i8] c"02/09/2014\00"
@.str.9 = [11 x i8] c"15/09/2014\00"
@.str.10 = [9 x i8] c"02/07/20\00"
@.str.11 = [11 x i8] c"02/09/5123\00"
@str = [3 x i8] c"ok\00"
define i32 @test_is_date() {
%1 = alloca [20 x i8]
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = call i64 @is_date(i8* %3, i8* %4)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = call i64 @is_date(i8* %3, i8* %4)
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = call i64 @is_date(i8* %3, i8* %4)
%15 = icmp eq i64 %14, 0
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = call i64 @is_date(i8* %3, i8* %4)
%19 = icmp eq i64 %18, 0
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
%22 = call i64 @is_date(i8* %3, i8* %4)
%23 = icmp ne i64 %22, 0
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
%26 = call i64 @is_date(i8* %3, i8* %4)
%27 = icmp eq i64 %26, 0
%28 = zext i1 %27 to i32
%29 = call i32 @assert(i32 %28)
%30 = call i64 @is_date(i8* %3, i8* %4)
%31 = icmp eq i64 %30, 0
%32 = zext i1 %31 to i32
%33 = call i32 @assert(i32 %32)
%34 = call i64 @is_date(i8* %3, i8* %4)
%35 = icmp eq i64 %34, 0
%36 = zext i1 %35 to i32
%37 = call i32 @assert(i32 %36)
%38 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret i32 1
}