#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);
int /*<<< orphan*/ convert_standard_to_date(char *, char *, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int strlen(char *);
int test_convert_standard_to_date() {
  char datestr[20], date_format[20];
  char standard[20];
  printf("test_convert_standard_to_date...");
  sprintf(date_format, "%s", "%d/%m/%Y");
  sprintf(standard, "%s", "2017-05-20");
  convert_standard_to_date(standard, date_format, datestr);
  assert(strlen(datestr) == 10);
  assert(datestr[0] == '2');
  assert(datestr[1] == '0');
  assert(datestr[2] == '/');
  assert(datestr[3] == '0');
  assert(datestr[4] == '5');
  assert(datestr[5] == '/');
  assert(datestr[6] == '2');
  assert(datestr[7] == '0');
  assert(datestr[8] == '1');
  assert(datestr[9] == '7');
  assert(datestr[10] == 0);
  printf("ok\n");
  return 1;
}


x86 assembly (clang, -O0):
<test_convert_standard_to_date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    0xea1(%rip),%rdi
call   1050 <printf@plt>
lea    -0x40(%rbp),%rdi
lea    0xeb2(%rip),%rsi
lea    0xeae(%rip),%rdx
call   1070 <sprintf@plt>
lea    -0x60(%rbp),%rdi
lea    0xe9b(%rip),%rsi
lea    0xea0(%rip),%rdx
call   1070 <sprintf@plt>
lea    -0x60(%rbp),%rdi
lea    -0x40(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1030 <convert_standard_to_date@plt>
lea    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0xa,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
movsbl -0x20(%rbp),%eax
cmp    $0x32,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
movsbl -0x1f(%rbp),%eax
cmp    $0x30,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
movsbl -0x1e(%rbp),%eax
cmp    $0x2f,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
movsbl -0x1d(%rbp),%eax
cmp    $0x30,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
movsbl -0x1c(%rbp),%eax
cmp    $0x35,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
movsbl -0x1b(%rbp),%eax
cmp    $0x2f,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
movsbl -0x1a(%rbp),%eax
cmp    $0x32,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
movsbl -0x19(%rbp),%eax
cmp    $0x30,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
movsbl -0x18(%rbp),%eax
cmp    $0x31,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
movsbl -0x17(%rbp),%eax
cmp    $0x37,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
movsbl -0x16(%rbp),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    0xd99(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_convert_standard_to_date>:
push   %rbx
sub    $0x60,%rsp
lea    0xea4(%rip),%rdi
call   1060 <printf@plt>
movabs $0x59252f6d252f6425,%rax
2f 25 59
mov    %rax,0x40(%rsp)
movb   $0x0,0x48(%rsp)
movabs $0x2d35302d37313032,%rax
30 35 2d
mov    %rax,0x20(%rsp)
movl   $0x30322d,0x27(%rsp)
lea    0x20(%rsp),%rdi
lea    0x40(%rsp),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdx
call   1030 <convert_standard_to_date@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
xor    %edi,%edi
cmp    $0xa,%eax
sete   %dil
call   1070 <assert@plt>
xor    %edi,%edi
cmpb   $0x32,(%rsp)
sete   %dil
call   1070 <assert@plt>
xor    %edi,%edi
cmpb   $0x30,0x1(%rsp)
sete   %dil
call   1070 <assert@plt>
xor    %edi,%edi
cmpb   $0x2f,0x2(%rsp)
sete   %dil
call   1070 <assert@plt>
xor    %edi,%edi
cmpb   $0x30,0x3(%rsp)
sete   %dil
call   1070 <assert@plt>
xor    %edi,%edi
cmpb   $0x35,0x4(%rsp)
sete   %dil
call   1070 <assert@plt>
xor    %edi,%edi
cmpb   $0x2f,0x5(%rsp)
sete   %dil
call   1070 <assert@plt>
xor    %edi,%edi
cmpb   $0x32,0x6(%rsp)
sete   %dil
call   1070 <assert@plt>
xor    %edi,%edi
cmpb   $0x30,0x7(%rsp)
sete   %dil
call   1070 <assert@plt>
xor    %edi,%edi
cmpb   $0x31,0x8(%rsp)
sete   %dil
call   1070 <assert@plt>
xor    %edi,%edi
cmpb   $0x37,0x9(%rsp)
sete   %dil
call   1070 <assert@plt>
xor    %edi,%edi
cmpb   $0x0,0xa(%rsp)
sete   %dil
call   1070 <assert@plt>
lea    0xdc8(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%eax
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"test_convert_standard_to_date...\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [9 x i8] c"%d/%m/%Y\00"
@.str.3 = [11 x i8] c"2017-05-20\00"
@.str.4 = [4 x i8] c"ok\0A\00"
define i32 @test_convert_standard_to_date() {
%1 = alloca [20 x i8]
%2 = alloca [20 x i8]
%3 = alloca [20 x i8]
%4 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, 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))
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%8 = call i32 @sprintf(i8* %7, 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.3, i64 0, i64 0))
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%10 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%11 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%12 = call i32 @convert_standard_to_date(i8* %9, i8* %10, i8* %11)
%13 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%14 = call i32 @strlen(i8* %13)
%15 = icmp eq i32 %14, 10
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 50
%22 = zext i1 %21 to i32
%23 = call i32 @assert(i32 %22)
%24 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 1
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 48
%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 2
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 47
%34 = zext i1 %33 to i32
%35 = call i32 @assert(i32 %34)
%36 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 3
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = icmp eq i32 %38, 48
%40 = zext i1 %39 to i32
%41 = call i32 @assert(i32 %40)
%42 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 4
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = icmp eq i32 %44, 53
%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 5
%49 = load i8, i8* %48
%50 = sext i8 %49 to i32
%51 = icmp eq i32 %50, 47
%52 = zext i1 %51 to i32
%53 = call i32 @assert(i32 %52)
%54 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 6
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
%57 = icmp eq i32 %56, 50
%58 = zext i1 %57 to i32
%59 = call i32 @assert(i32 %58)
%60 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 7
%61 = load i8, i8* %60
%62 = sext i8 %61 to i32
%63 = icmp eq i32 %62, 48
%64 = zext i1 %63 to i32
%65 = call i32 @assert(i32 %64)
%66 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 8
%67 = load i8, i8* %66
%68 = sext i8 %67 to i32
%69 = icmp eq i32 %68, 49
%70 = zext i1 %69 to i32
%71 = call i32 @assert(i32 %70)
%72 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 9
%73 = load i8, i8* %72
%74 = sext i8 %73 to i32
%75 = icmp eq i32 %74, 55
%76 = zext i1 %75 to i32
%77 = call i32 @assert(i32 %76)
%78 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 10
%79 = load i8, i8* %78
%80 = sext i8 %79 to i32
%81 = icmp eq i32 %80, 0
%82 = zext i1 %81 to i32
%83 = call i32 @assert(i32 %82)
%84 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [33 x i8] c"test_convert_standard_to_date...\00"
@.str.2 = [9 x i8] c"%d/%m/%Y\00"
@.str.3 = [11 x i8] c"2017-05-20\00"
@str = [3 x i8] c"ok\00"
define i32 @test_convert_standard_to_date() {
%1 = alloca [20 x i8]
%2 = alloca [20 x i8]
%3 = alloca [20 x i8]
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @convert_standard_to_date(i8* %6, i8* %5, i8* %4)
%9 = call i32 @strlen(i8* %4)
%10 = icmp eq i32 %9, 10
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i8, i8* %4
%14 = icmp eq i8 %13, 50
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 1
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 48
%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 2
%23 = load i8, i8* %22
%24 = icmp eq i8 %23, 47
%25 = zext i1 %24 to i32
%26 = call i32 @assert(i32 %25)
%27 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 3
%28 = load i8, i8* %27
%29 = icmp eq i8 %28, 48
%30 = zext i1 %29 to i32
%31 = call i32 @assert(i32 %30)
%32 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 4
%33 = load i8, i8* %32
%34 = icmp eq i8 %33, 53
%35 = zext i1 %34 to i32
%36 = call i32 @assert(i32 %35)
%37 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 5
%38 = load i8, i8* %37
%39 = icmp eq i8 %38, 47
%40 = zext i1 %39 to i32
%41 = call i32 @assert(i32 %40)
%42 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 6
%43 = load i8, i8* %42
%44 = icmp eq i8 %43, 50
%45 = zext i1 %44 to i32
%46 = call i32 @assert(i32 %45)
%47 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 7
%48 = load i8, i8* %47
%49 = icmp eq i8 %48, 48
%50 = zext i1 %49 to i32
%51 = call i32 @assert(i32 %50)
%52 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 8
%53 = load i8, i8* %52
%54 = icmp eq i8 %53, 49
%55 = zext i1 %54 to i32
%56 = call i32 @assert(i32 %55)
%57 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 9
%58 = load i8, i8* %57
%59 = icmp eq i8 %58, 55
%60 = zext i1 %59 to i32
%61 = call i32 @assert(i32 %60)
%62 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 10
%63 = load i8, i8* %62
%64 = icmp eq i8 %63, 0
%65 = zext i1 %64 to i32
%66 = call i32 @assert(i32 %65)
%67 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret i32 1
}