#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*/ sprintf(char *, char *, char *, char *, char *, char *,
                           char *);
int /*<<< orphan*/ sscanf(char *, char *, char *, char *, char *, char *,
                          char *);
void formatDate(char *dateIn, char *dateOut) {
  char buffer[5][100] = {0};
  sscanf(dateIn, "%s%s%s%s%s", buffer[0], buffer[1], buffer[2], buffer[3],
         buffer[4]);
  sprintf(dateOut, "%s %s %s %s %s\n", buffer[0], buffer[1], buffer[2],
          buffer[3], buffer[4]);
}


x86 assembly (clang, -O0):
<formatDate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
xor    %esi,%esi
mov    $0x1f4,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
lea    -0x210(%rbp),%rdx
lea    -0x210(%rbp),%rcx
add    $0x64,%rcx
lea    -0x210(%rbp),%r8
add    $0xc8,%r8
lea    -0x210(%rbp),%r9
add    $0x12c,%r9
lea    -0x210(%rbp),%rax
add    $0x190,%rax
lea    0xe64(%rip),%rsi
mov    %rax,(%rsp)
call   1040 <sscanf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x210(%rbp),%rdx
lea    -0x210(%rbp),%rcx
add    $0x64,%rcx
lea    -0x210(%rbp),%r8
add    $0xc8,%r8
lea    -0x210(%rbp),%r9
add    $0x12c,%r9
lea    -0x210(%rbp),%rax
add    $0x190,%rax
lea    0xe20(%rip),%rsi
mov    %rax,(%rsp)
call   1050 <sprintf@plt>
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<formatDate>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x208,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x10(%rsp),%r15
mov    $0x1f4,%edx
mov    %r15,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
lea    0x74(%rsp),%rcx
lea    0xd8(%rsp),%r13
lea    0x13c(%rsp),%rbp
lea    0x1a0(%rsp),%r12
mov    %r12,(%rsp)
lea    0xe7d(%rip),%rsi
mov    %rbx,%rdi
mov    %r15,%rdx
mov    %rcx,%rbx
mov    %r13,%r8
mov    %rbp,%r9
call   1040 <sscanf@plt>
mov    %r12,(%rsp)
lea    0xe69(%rip),%rsi
mov    %r14,%rdi
mov    %r15,%rdx
mov    %rbx,%rcx
mov    %r13,%r8
mov    %rbp,%r9
call   1050 <sprintf@plt>
add    $0x208,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%s%s%s%s%s\00"
@.str.1 = [16 x i8] c"%s %s %s %s %s\0A\00"
define void @formatDate(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [5 x [100 x i8]]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = bitcast [5 x [100 x i8]]* %5 to i8*
%7 = load i8*, i8** %3
%8 = getelementptr inbounds [5 x [100 x i8]], [5 x [100 x i8]]* %5, i64 0, i64 0
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%10 = getelementptr inbounds [5 x [100 x i8]], [5 x [100 x i8]]* %5, i64 0, i64 1
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%12 = getelementptr inbounds [5 x [100 x i8]], [5 x [100 x i8]]* %5, i64 0, i64 2
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %12, i64 0, i64 0
%14 = getelementptr inbounds [5 x [100 x i8]], [5 x [100 x i8]]* %5, i64 0, i64 3
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %14, i64 0, i64 0
%16 = getelementptr inbounds [5 x [100 x i8]], [5 x [100 x i8]]* %5, i64 0, i64 4
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %16, i64 0, i64 0
%18 = call i32 @sscanf(i8* %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %11, i8* %13, i8* %15, i8* %17)
%19 = load i8*, i8** %4
%20 = getelementptr inbounds [5 x [100 x i8]], [5 x [100 x i8]]* %5, i64 0, i64 0
%21 = getelementptr inbounds [100 x i8], [100 x i8]* %20, i64 0, i64 0
%22 = getelementptr inbounds [5 x [100 x i8]], [5 x [100 x i8]]* %5, i64 0, i64 1
%23 = getelementptr inbounds [100 x i8], [100 x i8]* %22, i64 0, i64 0
%24 = getelementptr inbounds [5 x [100 x i8]], [5 x [100 x i8]]* %5, i64 0, i64 2
%25 = getelementptr inbounds [100 x i8], [100 x i8]* %24, i64 0, i64 0
%26 = getelementptr inbounds [5 x [100 x i8]], [5 x [100 x i8]]* %5, i64 0, i64 3
%27 = getelementptr inbounds [100 x i8], [100 x i8]* %26, i64 0, i64 0
%28 = getelementptr inbounds [5 x [100 x i8]], [5 x [100 x i8]]* %5, i64 0, i64 4
%29 = getelementptr inbounds [100 x i8], [100 x i8]* %28, i64 0, i64 0
%30 = call i32 @sprintf(i8* %19, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %21, i8* %23, i8* %25, i8* %27, i8* %29)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s%s%s%s%s\00"
@.str.1 = [16 x i8] c"%s %s %s %s %s\0A\00"
define void @formatDate(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = alloca [5 x [100 x i8]]
%4 = getelementptr inbounds [5 x [100 x i8]], [5 x [100 x i8]]* %3, i64 0, i64 0, i64 0
%5 = getelementptr inbounds [5 x [100 x i8]], [5 x [100 x i8]]* %3, i64 0, i64 1, i64 0
%6 = getelementptr inbounds [5 x [100 x i8]], [5 x [100 x i8]]* %3, i64 0, i64 2, i64 0
%7 = getelementptr inbounds [5 x [100 x i8]], [5 x [100 x i8]]* %3, i64 0, i64 3, i64 0
%8 = getelementptr inbounds [5 x [100 x i8]], [5 x [100 x i8]]* %3, i64 0, i64 4, i64 0
%9 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %5, i8* %6, i8* %7, i8* %8)
%10 = call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %4, i8* %5, i8* %6, i8* %7, i8* %8)
ret void
}