#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 *, int *, int *, char *, char *,
                          char *, char *, char *, char *);
void splitHeader(char *header, char *id, int *nbColumns, int *nbLines,
                 char *type, char *date) {
  char buffer[5][100] = {0};
  sscanf(header, "%s\t%d\t%d\t%s\t%s%s%s%s%s", id, nbColumns, nbLines, type,
         buffer[0], buffer[1], buffer[2], buffer[3], buffer[4]);
  sprintf(date, "%s %s %s %s %s\n", buffer[0], buffer[1], buffer[2], buffer[3],
          buffer[4]);
}


x86 assembly (clang, -O0):
<splitHeader>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x260,%rsp
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    %r8,-0x38(%rbp)
mov    %r9,-0x40(%rbp)
lea    -0x240(%rbp),%rdi
xor    %esi,%esi
mov    $0x1f4,%edx
call   1030 <memset@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    -0x38(%rbp),%r9
lea    -0x240(%rbp),%r14
lea    -0x240(%rbp),%rbx
add    $0x64,%rbx
lea    -0x240(%rbp),%r11
add    $0xc8,%r11
lea    -0x240(%rbp),%r10
add    $0x12c,%r10
lea    -0x240(%rbp),%rax
add    $0x190,%rax
lea    0xe41(%rip),%rsi
mov    %r14,(%rsp)
mov    %rbx,0x8(%rsp)
mov    %r11,0x10(%rsp)
mov    %r10,0x18(%rsp)
mov    %rax,0x20(%rsp)
call   1040 <sscanf@plt>
mov    -0x40(%rbp),%rdi
lea    -0x240(%rbp),%rdx
lea    -0x240(%rbp),%rcx
add    $0x64,%rcx
lea    -0x240(%rbp),%r8
add    $0xc8,%r8
lea    -0x240(%rbp),%r9
add    $0x12c,%r9
lea    -0x240(%rbp),%rax
add    $0x190,%rax
lea    0xdf5(%rip),%rsi
mov    %rax,(%rsp)
call   1050 <sprintf@plt>
add    $0x260,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<splitHeader>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x208,%rsp
mov    %r9,0x8(%rsp)
mov    %r8,%r12
mov    %rcx,%r13
mov    %rdx,%rbx
mov    %rsi,%rbp
mov    %rdi,%r14
lea    0x10(%rsp),%rdi
mov    $0x1f4,%edx
xor    %esi,%esi
call   1030 <memset@plt>
lea    0x74(%rsp),%r10
lea    0xd8(%rsp),%r11
lea    0x13c(%rsp),%rax
lea    0x1a0(%rsp),%r15
sub    $0x8,%rsp
lea    0xe72(%rip),%rsi
mov    %r14,%rdi
mov    %rbp,%rdx
mov    %rbx,%rcx
mov    %r13,%r8
mov    %r12,%r9
push   %r15
push   %rax
mov    %rax,%r14
push   %r11
mov    %r11,%rbp
push   %r10
mov    %r10,%rbx
lea    0x38(%rsp),%rax
push   %rax
call   1040 <sscanf@plt>
add    $0x28,%rsp
lea    0xe54(%rip),%rsi
mov    0x10(%rsp),%rdi
lea    0x18(%rsp),%rdx
mov    %rbx,%rcx
mov    %rbp,%r8
mov    %r14,%r9
push   %r15
call   1050 <sprintf@plt>
add    $0x218,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"%s\09%d\09%d\09%s\09%s%s%s%s%s\00"
@.str.1 = [16 x i8] c"%s %s %s %s %s\0A\00"
define void @splitHeader(i8* %0, i8* %1, i32* %2, i32* %3, i8* %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca [5 x [100 x i8]]
store i8* %0, i8** %7
store i8* %1, i8** %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%14 = bitcast [5 x [100 x i8]]* %13 to i8*
%15 = load i8*, i8** %7
%16 = load i8*, i8** %8
%17 = load i32*, i32** %9
%18 = load i32*, i32** %10
%19 = load i8*, i8** %11
%20 = getelementptr inbounds [5 x [100 x i8]], [5 x [100 x i8]]* %13, 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]]* %13, 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]]* %13, 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]]* %13, 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]]* %13, i64 0, i64 4
%29 = getelementptr inbounds [100 x i8], [100 x i8]* %28, i64 0, i64 0
%30 = call i32 @sscanf(i8* %15, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %16, i32* %17, i32* %18, i8* %19, i8* %21, i8* %23, i8* %25, i8* %27, i8* %29)
%31 = load i8*, i8** %12
%32 = getelementptr inbounds [5 x [100 x i8]], [5 x [100 x i8]]* %13, i64 0, i64 0
%33 = getelementptr inbounds [100 x i8], [100 x i8]* %32, i64 0, i64 0
%34 = getelementptr inbounds [5 x [100 x i8]], [5 x [100 x i8]]* %13, i64 0, i64 1
%35 = getelementptr inbounds [100 x i8], [100 x i8]* %34, i64 0, i64 0
%36 = getelementptr inbounds [5 x [100 x i8]], [5 x [100 x i8]]* %13, i64 0, i64 2
%37 = getelementptr inbounds [100 x i8], [100 x i8]* %36, i64 0, i64 0
%38 = getelementptr inbounds [5 x [100 x i8]], [5 x [100 x i8]]* %13, i64 0, i64 3
%39 = getelementptr inbounds [100 x i8], [100 x i8]* %38, i64 0, i64 0
%40 = getelementptr inbounds [5 x [100 x i8]], [5 x [100 x i8]]* %13, i64 0, i64 4
%41 = getelementptr inbounds [100 x i8], [100 x i8]* %40, i64 0, i64 0
%42 = call i32 @sprintf(i8* %31, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %33, i8* %35, i8* %37, i8* %39, i8* %41)
ret void
}

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