#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 strlen(char *);
char *date_convert_american_sans_slashes(char *compressed_date_string) {
  static char return_date[16];
  if (strlen(compressed_date_string) == 5) {
    *(return_date + 0) = '0';
  } else if (strlen(compressed_date_string) == 6) {
    *(return_date + 0) = *compressed_date_string++;
  } else {
    return (char *)0;
  }
  *(return_date + 1) = *compressed_date_string++;
  *(return_date + 2) = '/';
  *(return_date + 3) = *compressed_date_string++;
  *(return_date + 4) = *compressed_date_string++;
  *(return_date + 5) = '/';
  if (*compressed_date_string <= '3') {
    *(return_date + 6) = '2';
    *(return_date + 7) = '0';
  } else {
    *(return_date + 6) = '1';
    *(return_date + 7) = '9';
  }
  *(return_date + 8) = *compressed_date_string++;
  *(return_date + 9) = *compressed_date_string++;
  return return_date;
}


x86 assembly (clang, -O0):
<date_convert_american_sans_slashes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x5,%eax
jne    113a <date_convert_american_sans_slashes+0x2a>
movb   $0x30,0x2f0b(%rip)
jmp    117a <date_convert_american_sans_slashes+0x6a>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x6,%eax
jne    1168 <date_convert_american_sans_slashes+0x58>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,0x2edd(%rip)
jmp    1175 <date_convert_american_sans_slashes+0x65>
movq   $0x0,-0x8(%rbp)
jmp    1237 <date_convert_american_sans_slashes+0x127>
jmp    117a <date_convert_american_sans_slashes+0x6a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,0x2eb0(%rip)
movb   $0x2f,0x2eaa(%rip)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,0x2e94(%rip)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,0x2e7e(%rip)
movb   $0x2f,0x2e78(%rip)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x33,%eax
jg     11f0 <date_convert_american_sans_slashes+0xe0>
movb   $0x32,0x2e62(%rip)
movb   $0x30,0x2e5c(%rip)
jmp    11fe <date_convert_american_sans_slashes+0xee>
movb   $0x31,0x2e4f(%rip)
movb   $0x39,0x2e49(%rip)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,0x2e33(%rip)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,0x2e1d(%rip)
lea    0x2e0d(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_convert_american_sans_slashes>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    $0x30,%cl
cmp    $0x5,%eax
je     1133 <date_convert_american_sans_slashes+0x23>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    $0x6,%eax
jne    119d <date_convert_american_sans_slashes+0x8d>
mov    (%rbx),%cl
add    $0x1,%rbx
mov    %cl,0x2f07(%rip)
lea    0x2f00(%rip),%rax
mov    (%rbx),%cl
mov    %cl,0x2ef9(%rip)
movb   $0x2f,0x2ef3(%rip)
mov    0x1(%rbx),%cl
mov    %cl,0x2eeb(%rip)
mov    0x2(%rbx),%cl
mov    %cl,0x2ee3(%rip)
movb   $0x2f,0x2edd(%rip)
xor    %ecx,%ecx
cmpb   $0x34,0x3(%rbx)
setl   %dl
setge  %cl
add    $0x31,%dl
lea    (%rcx,%rcx,8),%ecx
add    $0x30,%ecx
mov    %dl,0x2ec3(%rip)
mov    %cl,0x2ebe(%rip)
mov    0x3(%rbx),%cl
mov    %cl,0x2eb6(%rip)
mov    0x4(%rbx),%cl
mov    %cl,0x2eae(%rip)
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@date_convert_american_sans_slashes.return_date = internal global [16 x i8] zeroinitializer
define i8* @date_convert_american_sans_slashes(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @strlen(i8* %4)
%6 = icmp eq i32 %5, 5
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 48, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @date_convert_american_sans_slashes.return_date, i64 0, i64 0)
br label %18
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @strlen(i8* %9)
%11 = icmp eq i32 %10, 6
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %3
%15 = load i8, i8* %13
store i8 %15, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @date_convert_american_sans_slashes.return_date, i64 0, i64 0)
br label %17
16: ; preds = %8
store i8* null, i8** %2
br label %41
17: ; preds = %12
br label %18
18: ; preds = %17, %7
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %3
%21 = load i8, i8* %19
store i8 %21, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @date_convert_american_sans_slashes.return_date, i64 0, i64 1)
store i8 47, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @date_convert_american_sans_slashes.return_date, i64 0, i64 2)
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %3
%24 = load i8, i8* %22
store i8 %24, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @date_convert_american_sans_slashes.return_date, i64 0, i64 3)
%25 = load i8*, i8** %3
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %3
%27 = load i8, i8* %25
store i8 %27, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @date_convert_american_sans_slashes.return_date, i64 0, i64 4)
store i8 47, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @date_convert_american_sans_slashes.return_date, i64 0, i64 5)
%28 = load i8*, i8** %3
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp sle i32 %30, 51
br i1 %31, label %32, label %33
32: ; preds = %18
store i8 50, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @date_convert_american_sans_slashes.return_date, i64 0, i64 6)
store i8 48, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @date_convert_american_sans_slashes.return_date, i64 0, i64 7)
br label %34
33: ; preds = %18
store i8 49, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @date_convert_american_sans_slashes.return_date, i64 0, i64 6)
store i8 57, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @date_convert_american_sans_slashes.return_date, i64 0, i64 7)
br label %34
34: ; preds = %33, %32
%35 = load i8*, i8** %3
%36 = getelementptr inbounds i8, i8* %35, i32 1
store i8* %36, i8** %3
%37 = load i8, i8* %35
store i8 %37, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @date_convert_american_sans_slashes.return_date, i64 0, i64 8)
%38 = load i8*, i8** %3
%39 = getelementptr inbounds i8, i8* %38, i32 1
store i8* %39, i8** %3
%40 = load i8, i8* %38
store i8 %40, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @date_convert_american_sans_slashes.return_date, i64 0, i64 9)
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @date_convert_american_sans_slashes.return_date, i64 0, i64 0), i8** %2
br label %41
41: ; preds = %34, %16
%42 = load i8*, i8** %2
ret i8* %42
}

LLVM IR (-O2):
@date_convert_american_sans_slashes.return_date = internal global [16 x i8] zeroinitializer
define i8* @date_convert_american_sans_slashes(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp eq i32 %2, 5
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = tail call i32 @strlen(i8* %0)
%6 = icmp eq i32 %5, 6
br i1 %6, label %7, label %26
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %0, i64 1
%9 = load i8, i8* %0
br label %10
10: ; preds = %1, %7
%11 = phi i8 [ %9, %7 ], [ 48, %1 ]
%12 = phi i8* [ %8, %7 ], [ %0, %1 ]
store i8 %11, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @date_convert_american_sans_slashes.return_date, i64 0, i64 0)
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %12
store i8 %14, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @date_convert_american_sans_slashes.return_date, i64 0, i64 1)
store i8 47, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @date_convert_american_sans_slashes.return_date, i64 0, i64 2)
%15 = getelementptr inbounds i8, i8* %12, i64 2
%16 = load i8, i8* %13
store i8 %16, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @date_convert_american_sans_slashes.return_date, i64 0, i64 3)
%17 = getelementptr inbounds i8, i8* %12, i64 3
%18 = load i8, i8* %15
store i8 %18, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @date_convert_american_sans_slashes.return_date, i64 0, i64 4)
store i8 47, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @date_convert_american_sans_slashes.return_date, i64 0, i64 5)
%19 = load i8, i8* %17
%20 = icmp slt i8 %19, 52
%21 = select i1 %20, i8 50, i8 49
%22 = select i1 %20, i8 48, i8 57
store i8 %21, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @date_convert_american_sans_slashes.return_date, i64 0, i64 6)
store i8 %22, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @date_convert_american_sans_slashes.return_date, i64 0, i64 7)
%23 = getelementptr inbounds i8, i8* %12, i64 4
%24 = load i8, i8* %17
store i8 %24, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @date_convert_american_sans_slashes.return_date, i64 0, i64 8)
%25 = load i8, i8* %23
store i8 %25, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @date_convert_american_sans_slashes.return_date, i64 0, i64 9)
br label %26
26: ; preds = %4, %10
%27 = phi i8* [ getelementptr inbounds ([16 x i8], [16 x i8]* @date_convert_american_sans_slashes.return_date, i64 0, i64 0), %10 ], [ null, %4 ]
ret i8* %27
}