#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 */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *libewf_header_value_string_alloc(int);
char **libewf_split_string(char *, char, int *);
int strlen(char *);
char *libewf_convert_date_header_value(char *header_value,
                                       uint8_t date_format) {
  char **date_elements;
  char *date_string;
  uint32_t date_element_count = 0;
  uint32_t date_element_iterator = 0;
  if (header_value == NULL) {
    return (NULL);
  }
  date_elements = libewf_split_string(header_value, ' ', &date_element_count);
  if (date_element_count != 6) {
    return (NULL);
  }
  date_string = libewf_header_value_string_alloc(20);
  if (date_format == 0x02) {
    if (strlen(date_elements[1]) == 1) {
      date_string[0] = '0';
      date_string[1] = date_elements[1][0];
    } else {
      date_string[0] = date_elements[1][0];
      date_string[1] = date_elements[1][1];
    }
    date_string[2] = '/';
    if (strlen(date_elements[2]) == 1) {
      date_string[3] = '0';
      date_string[4] = date_elements[2][0];
    } else {
      date_string[3] = date_elements[2][0];
      date_string[4] = date_elements[2][1];
    }
  } else if (date_format == 0x01) {
    if (strlen(date_elements[2]) == 1) {
      date_string[0] = '0';
      date_string[1] = date_elements[2][0];
    } else {
      date_string[0] = date_elements[2][0];
      date_string[1] = date_elements[2][1];
    }
    date_string[2] = '/';
    if (strlen(date_elements[1]) == 1) {
      date_string[3] = '0';
      date_string[4] = date_elements[1][0];
    } else {
      date_string[3] = date_elements[1][0];
      date_string[4] = date_elements[1][1];
    }
  }
  date_string[5] = '/';
  date_string[6] = date_elements[0][0];
  date_string[7] = date_elements[0][1];
  date_string[8] = date_elements[0][2];
  date_string[9] = date_elements[0][3];
  date_string[10] = ' ';
  if (strlen(date_elements[3]) == 1) {
    date_string[11] = '0';
    date_string[12] = date_elements[3][0];
  } else {
    date_string[11] = date_elements[3][0];
    date_string[12] = date_elements[3][1];
  }
  date_string[13] = ':';
  if (strlen(date_elements[4]) == 1) {
    date_string[14] = '0';
    date_string[15] = date_elements[4][0];
  } else {
    date_string[14] = date_elements[4][0];
    date_string[15] = date_elements[4][1];
  }
  date_string[16] = ':';
  if (strlen(date_elements[5]) == 1) {
    date_string[17] = '0';
    date_string[18] = date_elements[5][0];
  } else {
    date_string[17] = date_elements[5][0];
    date_string[18] = date_elements[5][1];
  }
  date_string[19] = '\0';
  while (date_element_iterator < date_element_count) {
    free(date_elements[date_element_iterator]);
    date_element_iterator++;
  }
  return (date_string);
}


x86 assembly (clang, -O0):
<libewf_convert_date_header_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1175 <libewf_convert_date_header_value+0x35>
movq   $0x0,-0x8(%rbp)
jmp    14de <libewf_convert_date_header_value+0x39e>
mov    -0x10(%rbp),%rdi
mov    $0x20,%esi
lea    -0x2c(%rbp),%rdx
call   1060 <libewf_split_string@plt>
mov    %rax,-0x20(%rbp)
cmpl   $0x6,-0x2c(%rbp)
je     11a2 <libewf_convert_date_header_value+0x62>
movq   $0x0,-0x8(%rbp)
jmp    14de <libewf_convert_date_header_value+0x39e>
mov    $0x14,%edi
call   1050 <libewf_header_value_string_alloc@plt>
mov    %rax,-0x28(%rbp)
cmpl   $0x2,-0x14(%rbp)
jne    1273 <libewf_convert_date_header_value+0x133>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <strlen@plt>
cmp    $0x1,%eax
jne    11ed <libewf_convert_date_header_value+0xad>
mov    -0x28(%rbp),%rax
movb   $0x30,(%rax)
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%cl
mov    -0x28(%rbp),%rax
mov    %cl,0x1(%rax)
jmp    120f <libewf_convert_date_header_value+0xcf>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%cl
mov    -0x28(%rbp),%rax
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x1(%rax),%cl
mov    -0x28(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x28(%rbp),%rax
movb   $0x2f,0x2(%rax)
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <strlen@plt>
cmp    $0x1,%eax
jne    124b <libewf_convert_date_header_value+0x10b>
mov    -0x28(%rbp),%rax
movb   $0x30,0x3(%rax)
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rax
mov    (%rax),%cl
mov    -0x28(%rbp),%rax
mov    %cl,0x4(%rax)
jmp    126e <libewf_convert_date_header_value+0x12e>
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rax
mov    (%rax),%cl
mov    -0x28(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rax
mov    0x1(%rax),%cl
mov    -0x28(%rbp),%rax
mov    %cl,0x4(%rax)
jmp    133b <libewf_convert_date_header_value+0x1fb>
cmpl   $0x1,-0x14(%rbp)
jne    1336 <libewf_convert_date_header_value+0x1f6>
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <strlen@plt>
cmp    $0x1,%eax
jne    12b0 <libewf_convert_date_header_value+0x170>
mov    -0x28(%rbp),%rax
movb   $0x30,(%rax)
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rax
mov    (%rax),%cl
mov    -0x28(%rbp),%rax
mov    %cl,0x1(%rax)
jmp    12d2 <libewf_convert_date_header_value+0x192>
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rax
mov    (%rax),%cl
mov    -0x28(%rbp),%rax
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rax
mov    0x1(%rax),%cl
mov    -0x28(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x28(%rbp),%rax
movb   $0x2f,0x2(%rax)
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <strlen@plt>
cmp    $0x1,%eax
jne    130e <libewf_convert_date_header_value+0x1ce>
mov    -0x28(%rbp),%rax
movb   $0x30,0x3(%rax)
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%cl
mov    -0x28(%rbp),%rax
mov    %cl,0x4(%rax)
jmp    1331 <libewf_convert_date_header_value+0x1f1>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%cl
mov    -0x28(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x1(%rax),%cl
mov    -0x28(%rbp),%rax
mov    %cl,0x4(%rax)
jmp    1336 <libewf_convert_date_header_value+0x1f6>
jmp    133b <libewf_convert_date_header_value+0x1fb>
mov    -0x28(%rbp),%rax
movb   $0x2f,0x5(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%cl
mov    -0x28(%rbp),%rax
mov    %cl,0x6(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    0x1(%rax),%cl
mov    -0x28(%rbp),%rax
mov    %cl,0x7(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    0x2(%rax),%cl
mov    -0x28(%rbp),%rax
mov    %cl,0x8(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    0x3(%rax),%cl
mov    -0x28(%rbp),%rax
mov    %cl,0x9(%rax)
mov    -0x28(%rbp),%rax
movb   $0x20,0xa(%rax)
mov    -0x20(%rbp),%rax
mov    0x18(%rax),%rdi
call   1040 <strlen@plt>
cmp    $0x1,%eax
jne    13c2 <libewf_convert_date_header_value+0x282>
mov    -0x28(%rbp),%rax
movb   $0x30,0xb(%rax)
mov    -0x20(%rbp),%rax
mov    0x18(%rax),%rax
mov    (%rax),%cl
mov    -0x28(%rbp),%rax
mov    %cl,0xc(%rax)
jmp    13e5 <libewf_convert_date_header_value+0x2a5>
mov    -0x20(%rbp),%rax
mov    0x18(%rax),%rax
mov    (%rax),%cl
mov    -0x28(%rbp),%rax
mov    %cl,0xb(%rax)
mov    -0x20(%rbp),%rax
mov    0x18(%rax),%rax
mov    0x1(%rax),%cl
mov    -0x28(%rbp),%rax
mov    %cl,0xc(%rax)
mov    -0x28(%rbp),%rax
movb   $0x3a,0xd(%rax)
mov    -0x20(%rbp),%rax
mov    0x20(%rax),%rdi
call   1040 <strlen@plt>
cmp    $0x1,%eax
jne    1421 <libewf_convert_date_header_value+0x2e1>
mov    -0x28(%rbp),%rax
movb   $0x30,0xe(%rax)
mov    -0x20(%rbp),%rax
mov    0x20(%rax),%rax
mov    (%rax),%cl
mov    -0x28(%rbp),%rax
mov    %cl,0xf(%rax)
jmp    1444 <libewf_convert_date_header_value+0x304>
mov    -0x20(%rbp),%rax
mov    0x20(%rax),%rax
mov    (%rax),%cl
mov    -0x28(%rbp),%rax
mov    %cl,0xe(%rax)
mov    -0x20(%rbp),%rax
mov    0x20(%rax),%rax
mov    0x1(%rax),%cl
mov    -0x28(%rbp),%rax
mov    %cl,0xf(%rax)
mov    -0x28(%rbp),%rax
movb   $0x3a,0x10(%rax)
mov    -0x20(%rbp),%rax
mov    0x28(%rax),%rdi
call   1040 <strlen@plt>
cmp    $0x1,%eax
jne    1480 <libewf_convert_date_header_value+0x340>
mov    -0x28(%rbp),%rax
movb   $0x30,0x11(%rax)
mov    -0x20(%rbp),%rax
mov    0x28(%rax),%rax
mov    (%rax),%cl
mov    -0x28(%rbp),%rax
mov    %cl,0x12(%rax)
jmp    14a3 <libewf_convert_date_header_value+0x363>
mov    -0x20(%rbp),%rax
mov    0x28(%rax),%rax
mov    (%rax),%cl
mov    -0x28(%rbp),%rax
mov    %cl,0x11(%rax)
mov    -0x20(%rbp),%rax
mov    0x28(%rax),%rax
mov    0x1(%rax),%cl
mov    -0x28(%rbp),%rax
mov    %cl,0x12(%rax)
mov    -0x28(%rbp),%rax
movb   $0x0,0x13(%rax)
mov    -0x30(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    14d6 <libewf_convert_date_header_value+0x396>
mov    -0x20(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    14ab <libewf_convert_date_header_value+0x36b>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libewf_convert_date_header_value>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
test   %rdi,%rdi
je     11a3 <libewf_convert_date_header_value+0x63>
mov    %esi,%ebp
lea    0xc(%rsp),%rdx
mov    $0x20,%esi
call   1060 <libewf_split_string@plt>
cmpl   $0x6,0xc(%rsp)
jne    11a3 <libewf_convert_date_header_value+0x63>
mov    %rax,%rbx
mov    $0x14,%edi
call   1050 <libewf_header_value_string_alloc@plt>
mov    %rax,%r14
cmp    $0x1,%ebp
je     11ab <libewf_convert_date_header_value+0x6b>
cmp    $0x2,%ebp
jne    1255 <libewf_convert_date_header_value+0x115>
mov    0x8(%rbx),%rdi
call   1040 <strlen@plt>
cmp    $0x1,%eax
jne    11c3 <libewf_convert_date_header_value+0x83>
movb   $0x30,(%r14)
mov    0x8(%rbx),%rax
jmp    11d4 <libewf_convert_date_header_value+0x94>
xor    %r14d,%r14d
jmp    1357 <libewf_convert_date_header_value+0x217>
mov    0x10(%rbx),%rdi
call   1040 <strlen@plt>
cmp    $0x1,%eax
jne    11f8 <libewf_convert_date_header_value+0xb8>
movb   $0x30,(%r14)
mov    0x10(%rbx),%rax
jmp    1209 <libewf_convert_date_header_value+0xc9>
mov    0x8(%rbx),%rax
mov    (%rax),%al
mov    %al,(%r14)
mov    0x8(%rbx),%rax
add    $0x1,%rax
mov    (%rax),%al
mov    %al,0x1(%r14)
movb   $0x2f,0x2(%r14)
mov    0x10(%rbx),%rdi
call   1040 <strlen@plt>
cmp    $0x1,%eax
jne    122d <libewf_convert_date_header_value+0xed>
movb   $0x30,0x3(%r14)
mov    0x10(%rbx),%rax
jmp    124f <libewf_convert_date_header_value+0x10f>
mov    0x10(%rbx),%rax
mov    (%rax),%al
mov    %al,(%r14)
mov    0x10(%rbx),%rax
add    $0x1,%rax
mov    (%rax),%al
mov    %al,0x1(%r14)
movb   $0x2f,0x2(%r14)
mov    0x8(%rbx),%rdi
call   1040 <strlen@plt>
cmp    $0x1,%eax
jne    123d <libewf_convert_date_header_value+0xfd>
movb   $0x30,0x3(%r14)
mov    0x8(%rbx),%rax
jmp    124f <libewf_convert_date_header_value+0x10f>
mov    0x10(%rbx),%rax
mov    (%rax),%al
mov    %al,0x3(%r14)
mov    0x10(%rbx),%rax
jmp    124b <libewf_convert_date_header_value+0x10b>
mov    0x8(%rbx),%rax
mov    (%rax),%al
mov    %al,0x3(%r14)
mov    0x8(%rbx),%rax
add    $0x1,%rax
mov    (%rax),%al
mov    %al,0x4(%r14)
movb   $0x2f,0x5(%r14)
mov    (%rbx),%rax
mov    (%rax),%al
mov    %al,0x6(%r14)
mov    (%rbx),%rax
mov    0x1(%rax),%al
mov    %al,0x7(%r14)
mov    (%rbx),%rax
mov    0x2(%rax),%al
mov    %al,0x8(%r14)
mov    (%rbx),%rax
mov    0x3(%rax),%al
mov    %al,0x9(%r14)
movb   $0x20,0xa(%r14)
mov    0x18(%rbx),%rdi
call   1040 <strlen@plt>
cmp    $0x1,%eax
jne    129f <libewf_convert_date_header_value+0x15f>
movb   $0x30,0xb(%r14)
mov    0x18(%rbx),%rax
jmp    12b1 <libewf_convert_date_header_value+0x171>
mov    0x18(%rbx),%rax
mov    (%rax),%al
mov    %al,0xb(%r14)
mov    0x18(%rbx),%rax
add    $0x1,%rax
mov    (%rax),%al
mov    %al,0xc(%r14)
movb   $0x3a,0xd(%r14)
mov    0x20(%rbx),%rdi
call   1040 <strlen@plt>
cmp    $0x1,%eax
jne    12d5 <libewf_convert_date_header_value+0x195>
movb   $0x30,0xe(%r14)
mov    0x20(%rbx),%rax
jmp    12e7 <libewf_convert_date_header_value+0x1a7>
mov    0x20(%rbx),%rax
mov    (%rax),%al
mov    %al,0xe(%r14)
mov    0x20(%rbx),%rax
add    $0x1,%rax
mov    (%rax),%al
mov    %al,0xf(%r14)
movb   $0x3a,0x10(%r14)
mov    0x28(%rbx),%rdi
call   1040 <strlen@plt>
cmp    $0x1,%eax
jne    130b <libewf_convert_date_header_value+0x1cb>
movb   $0x30,0x11(%r14)
mov    0x28(%rbx),%rax
jmp    131d <libewf_convert_date_header_value+0x1dd>
mov    0x28(%rbx),%rax
mov    (%rax),%al
mov    %al,0x11(%r14)
mov    0x28(%rbx),%rax
add    $0x1,%rax
mov    (%rax),%al
mov    %al,0x12(%r14)
movb   $0x0,0x13(%r14)
cmpl   $0x0,0xc(%rsp)
jle    1357 <libewf_convert_date_header_value+0x217>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%rbx,%rbp,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbp
movslq 0xc(%rsp),%rax
cmp    %rax,%rbp
jl     1340 <libewf_convert_date_header_value+0x200>
mov    %r14,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @libewf_convert_date_header_value(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 0, i32* %8
store i32 0, i32* %9
%10 = load i8*, i8** %4
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %13
12: ; preds = %2
store i8* null, i8** %3
br label %304
13: ; preds = %2
%14 = load i8*, i8** %4
%15 = call i8** @libewf_split_string(i8* %14, i8 signext 32, i32* %8)
store i8** %15, i8*** %6
%16 = load i32, i32* %8
%17 = icmp ne i32 %16, 6
br i1 %17, label %18, label %19
18: ; preds = %13
store i8* null, i8** %3
br label %304
19: ; preds = %13
%20 = call i8* @libewf_header_value_string_alloc(i32 20)
store i8* %20, i8** %7
%21 = load i32, i32* %5
%22 = icmp eq i32 %21, 2
br i1 %22, label %23, label %88
23: ; preds = %19
%24 = load i8**, i8*** %6
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i32 @strlen(i8* %26)
%28 = icmp eq i32 %27, 1
br i1 %28, label %29, label %39
29: ; preds = %23
%30 = load i8*, i8** %7
%31 = getelementptr inbounds i8, i8* %30, i64 0
store i8 48, i8* %31
%32 = load i8**, i8*** %6
%33 = getelementptr inbounds i8*, i8** %32, i64 1
%34 = load i8*, i8** %33
%35 = getelementptr inbounds i8, i8* %34, i64 0
%36 = load i8, i8* %35
%37 = load i8*, i8** %7
%38 = getelementptr inbounds i8, i8* %37, i64 1
store i8 %36, i8* %38
br label %54
39: ; preds = %23
%40 = load i8**, i8*** %6
%41 = getelementptr inbounds i8*, i8** %40, i64 1
%42 = load i8*, i8** %41
%43 = getelementptr inbounds i8, i8* %42, i64 0
%44 = load i8, i8* %43
%45 = load i8*, i8** %7
%46 = getelementptr inbounds i8, i8* %45, i64 0
store i8 %44, i8* %46
%47 = load i8**, i8*** %6
%48 = getelementptr inbounds i8*, i8** %47, i64 1
%49 = load i8*, i8** %48
%50 = getelementptr inbounds i8, i8* %49, i64 1
%51 = load i8, i8* %50
%52 = load i8*, i8** %7
%53 = getelementptr inbounds i8, i8* %52, i64 1
store i8 %51, i8* %53
br label %54
54: ; preds = %39, %29
%55 = load i8*, i8** %7
%56 = getelementptr inbounds i8, i8* %55, i64 2
store i8 47, i8* %56
%57 = load i8**, i8*** %6
%58 = getelementptr inbounds i8*, i8** %57, i64 2
%59 = load i8*, i8** %58
%60 = call i32 @strlen(i8* %59)
%61 = icmp eq i32 %60, 1
br i1 %61, label %62, label %72
62: ; preds = %54
%63 = load i8*, i8** %7
%64 = getelementptr inbounds i8, i8* %63, i64 3
store i8 48, i8* %64
%65 = load i8**, i8*** %6
%66 = getelementptr inbounds i8*, i8** %65, i64 2
%67 = load i8*, i8** %66
%68 = getelementptr inbounds i8, i8* %67, i64 0
%69 = load i8, i8* %68
%70 = load i8*, i8** %7
%71 = getelementptr inbounds i8, i8* %70, i64 4
store i8 %69, i8* %71
br label %87
72: ; preds = %54
%73 = load i8**, i8*** %6
%74 = getelementptr inbounds i8*, i8** %73, i64 2
%75 = load i8*, i8** %74
%76 = getelementptr inbounds i8, i8* %75, i64 0
%77 = load i8, i8* %76
%78 = load i8*, i8** %7
%79 = getelementptr inbounds i8, i8* %78, i64 3
store i8 %77, i8* %79
%80 = load i8**, i8*** %6
%81 = getelementptr inbounds i8*, i8** %80, i64 2
%82 = load i8*, i8** %81
%83 = getelementptr inbounds i8, i8* %82, i64 1
%84 = load i8, i8* %83
%85 = load i8*, i8** %7
%86 = getelementptr inbounds i8, i8* %85, i64 4
store i8 %84, i8* %86
br label %87
87: ; preds = %72, %62
br label %157
88: ; preds = %19
%89 = load i32, i32* %5
%90 = icmp eq i32 %89, 1
br i1 %90, label %91, label %156
91: ; preds = %88
%92 = load i8**, i8*** %6
%93 = getelementptr inbounds i8*, i8** %92, i64 2
%94 = load i8*, i8** %93
%95 = call i32 @strlen(i8* %94)
%96 = icmp eq i32 %95, 1
br i1 %96, label %97, label %107
97: ; preds = %91
%98 = load i8*, i8** %7
%99 = getelementptr inbounds i8, i8* %98, i64 0
store i8 48, i8* %99
%100 = load i8**, i8*** %6
%101 = getelementptr inbounds i8*, i8** %100, i64 2
%102 = load i8*, i8** %101
%103 = getelementptr inbounds i8, i8* %102, i64 0
%104 = load i8, i8* %103
%105 = load i8*, i8** %7
%106 = getelementptr inbounds i8, i8* %105, i64 1
store i8 %104, i8* %106
br label %122
107: ; preds = %91
%108 = load i8**, i8*** %6
%109 = getelementptr inbounds i8*, i8** %108, i64 2
%110 = load i8*, i8** %109
%111 = getelementptr inbounds i8, i8* %110, i64 0
%112 = load i8, i8* %111
%113 = load i8*, i8** %7
%114 = getelementptr inbounds i8, i8* %113, i64 0
store i8 %112, i8* %114
%115 = load i8**, i8*** %6
%116 = getelementptr inbounds i8*, i8** %115, i64 2
%117 = load i8*, i8** %116
%118 = getelementptr inbounds i8, i8* %117, i64 1
%119 = load i8, i8* %118
%120 = load i8*, i8** %7
%121 = getelementptr inbounds i8, i8* %120, i64 1
store i8 %119, i8* %121
br label %122
122: ; preds = %107, %97
%123 = load i8*, i8** %7
%124 = getelementptr inbounds i8, i8* %123, i64 2
store i8 47, i8* %124
%125 = load i8**, i8*** %6
%126 = getelementptr inbounds i8*, i8** %125, i64 1
%127 = load i8*, i8** %126
%128 = call i32 @strlen(i8* %127)
%129 = icmp eq i32 %128, 1
br i1 %129, label %130, label %140
130: ; preds = %122
%131 = load i8*, i8** %7
%132 = getelementptr inbounds i8, i8* %131, i64 3
store i8 48, i8* %132
%133 = load i8**, i8*** %6
%134 = getelementptr inbounds i8*, i8** %133, i64 1
%135 = load i8*, i8** %134
%136 = getelementptr inbounds i8, i8* %135, i64 0
%137 = load i8, i8* %136
%138 = load i8*, i8** %7
%139 = getelementptr inbounds i8, i8* %138, i64 4
store i8 %137, i8* %139
br label %155
140: ; preds = %122
%141 = load i8**, i8*** %6
%142 = getelementptr inbounds i8*, i8** %141, i64 1
%143 = load i8*, i8** %142
%144 = getelementptr inbounds i8, i8* %143, i64 0
%145 = load i8, i8* %144
%146 = load i8*, i8** %7
%147 = getelementptr inbounds i8, i8* %146, i64 3
store i8 %145, i8* %147
%148 = load i8**, i8*** %6
%149 = getelementptr inbounds i8*, i8** %148, i64 1
%150 = load i8*, i8** %149
%151 = getelementptr inbounds i8, i8* %150, i64 1
%152 = load i8, i8* %151
%153 = load i8*, i8** %7
%154 = getelementptr inbounds i8, i8* %153, i64 4
store i8 %152, i8* %154
br label %155
155: ; preds = %140, %130
br label %156
156: ; preds = %155, %88
br label %157
157: ; preds = %156, %87
%158 = load i8*, i8** %7
%159 = getelementptr inbounds i8, i8* %158, i64 5
store i8 47, i8* %159
%160 = load i8**, i8*** %6
%161 = getelementptr inbounds i8*, i8** %160, i64 0
%162 = load i8*, i8** %161
%163 = getelementptr inbounds i8, i8* %162, i64 0
%164 = load i8, i8* %163
%165 = load i8*, i8** %7
%166 = getelementptr inbounds i8, i8* %165, i64 6
store i8 %164, i8* %166
%167 = load i8**, i8*** %6
%168 = getelementptr inbounds i8*, i8** %167, i64 0
%169 = load i8*, i8** %168
%170 = getelementptr inbounds i8, i8* %169, i64 1
%171 = load i8, i8* %170
%172 = load i8*, i8** %7
%173 = getelementptr inbounds i8, i8* %172, i64 7
store i8 %171, i8* %173
%174 = load i8**, i8*** %6
%175 = getelementptr inbounds i8*, i8** %174, i64 0
%176 = load i8*, i8** %175
%177 = getelementptr inbounds i8, i8* %176, i64 2
%178 = load i8, i8* %177
%179 = load i8*, i8** %7
%180 = getelementptr inbounds i8, i8* %179, i64 8
store i8 %178, i8* %180
%181 = load i8**, i8*** %6
%182 = getelementptr inbounds i8*, i8** %181, i64 0
%183 = load i8*, i8** %182
%184 = getelementptr inbounds i8, i8* %183, i64 3
%185 = load i8, i8* %184
%186 = load i8*, i8** %7
%187 = getelementptr inbounds i8, i8* %186, i64 9
store i8 %185, i8* %187
%188 = load i8*, i8** %7
%189 = getelementptr inbounds i8, i8* %188, i64 10
store i8 32, i8* %189
%190 = load i8**, i8*** %6
%191 = getelementptr inbounds i8*, i8** %190, i64 3
%192 = load i8*, i8** %191
%193 = call i32 @strlen(i8* %192)
%194 = icmp eq i32 %193, 1
br i1 %194, label %195, label %205
195: ; preds = %157
%196 = load i8*, i8** %7
%197 = getelementptr inbounds i8, i8* %196, i64 11
store i8 48, i8* %197
%198 = load i8**, i8*** %6
%199 = getelementptr inbounds i8*, i8** %198, i64 3
%200 = load i8*, i8** %199
%201 = getelementptr inbounds i8, i8* %200, i64 0
%202 = load i8, i8* %201
%203 = load i8*, i8** %7
%204 = getelementptr inbounds i8, i8* %203, i64 12
store i8 %202, i8* %204
br label %220
205: ; preds = %157
%206 = load i8**, i8*** %6
%207 = getelementptr inbounds i8*, i8** %206, i64 3
%208 = load i8*, i8** %207
%209 = getelementptr inbounds i8, i8* %208, i64 0
%210 = load i8, i8* %209
%211 = load i8*, i8** %7
%212 = getelementptr inbounds i8, i8* %211, i64 11
store i8 %210, i8* %212
%213 = load i8**, i8*** %6
%214 = getelementptr inbounds i8*, i8** %213, i64 3
%215 = load i8*, i8** %214
%216 = getelementptr inbounds i8, i8* %215, i64 1
%217 = load i8, i8* %216
%218 = load i8*, i8** %7
%219 = getelementptr inbounds i8, i8* %218, i64 12
store i8 %217, i8* %219
br label %220
220: ; preds = %205, %195
%221 = load i8*, i8** %7
%222 = getelementptr inbounds i8, i8* %221, i64 13
store i8 58, i8* %222
%223 = load i8**, i8*** %6
%224 = getelementptr inbounds i8*, i8** %223, i64 4
%225 = load i8*, i8** %224
%226 = call i32 @strlen(i8* %225)
%227 = icmp eq i32 %226, 1
br i1 %227, label %228, label %238
228: ; preds = %220
%229 = load i8*, i8** %7
%230 = getelementptr inbounds i8, i8* %229, i64 14
store i8 48, i8* %230
%231 = load i8**, i8*** %6
%232 = getelementptr inbounds i8*, i8** %231, i64 4
%233 = load i8*, i8** %232
%234 = getelementptr inbounds i8, i8* %233, i64 0
%235 = load i8, i8* %234
%236 = load i8*, i8** %7
%237 = getelementptr inbounds i8, i8* %236, i64 15
store i8 %235, i8* %237
br label %253
238: ; preds = %220
%239 = load i8**, i8*** %6
%240 = getelementptr inbounds i8*, i8** %239, i64 4
%241 = load i8*, i8** %240
%242 = getelementptr inbounds i8, i8* %241, i64 0
%243 = load i8, i8* %242
%244 = load i8*, i8** %7
%245 = getelementptr inbounds i8, i8* %244, i64 14
store i8 %243, i8* %245
%246 = load i8**, i8*** %6
%247 = getelementptr inbounds i8*, i8** %246, i64 4
%248 = load i8*, i8** %247
%249 = getelementptr inbounds i8, i8* %248, i64 1
%250 = load i8, i8* %249
%251 = load i8*, i8** %7
%252 = getelementptr inbounds i8, i8* %251, i64 15
store i8 %250, i8* %252
br label %253
253: ; preds = %238, %228
%254 = load i8*, i8** %7
%255 = getelementptr inbounds i8, i8* %254, i64 16
store i8 58, i8* %255
%256 = load i8**, i8*** %6
%257 = getelementptr inbounds i8*, i8** %256, i64 5
%258 = load i8*, i8** %257
%259 = call i32 @strlen(i8* %258)
%260 = icmp eq i32 %259, 1
br i1 %260, label %261, label %271
261: ; preds = %253
%262 = load i8*, i8** %7
%263 = getelementptr inbounds i8, i8* %262, i64 17
store i8 48, i8* %263
%264 = load i8**, i8*** %6
%265 = getelementptr inbounds i8*, i8** %264, i64 5
%266 = load i8*, i8** %265
%267 = getelementptr inbounds i8, i8* %266, i64 0
%268 = load i8, i8* %267
%269 = load i8*, i8** %7
%270 = getelementptr inbounds i8, i8* %269, i64 18
store i8 %268, i8* %270
br label %286
271: ; preds = %253
%272 = load i8**, i8*** %6
%273 = getelementptr inbounds i8*, i8** %272, i64 5
%274 = load i8*, i8** %273
%275 = getelementptr inbounds i8, i8* %274, i64 0
%276 = load i8, i8* %275
%277 = load i8*, i8** %7
%278 = getelementptr inbounds i8, i8* %277, i64 17
store i8 %276, i8* %278
%279 = load i8**, i8*** %6
%280 = getelementptr inbounds i8*, i8** %279, i64 5
%281 = load i8*, i8** %280
%282 = getelementptr inbounds i8, i8* %281, i64 1
%283 = load i8, i8* %282
%284 = load i8*, i8** %7
%285 = getelementptr inbounds i8, i8* %284, i64 18
store i8 %283, i8* %285
br label %286
286: ; preds = %271, %261
%287 = load i8*, i8** %7
%288 = getelementptr inbounds i8, i8* %287, i64 19
store i8 0, i8* %288
br label %289
289: ; preds = %293, %286
%290 = load i32, i32* %9
%291 = load i32, i32* %8
%292 = icmp slt i32 %290, %291
br i1 %292, label %293, label %302
293: ; preds = %289
%294 = load i8**, i8*** %6
%295 = load i32, i32* %9
%296 = sext i32 %295 to i64
%297 = getelementptr inbounds i8*, i8** %294, i64 %296
%298 = load i8*, i8** %297
%299 = call i32 @free(i8* %298)
%300 = load i32, i32* %9
%301 = add nsw i32 %300, 1
store i32 %301, i32* %9
br label %289
302: ; preds = %289
%303 = load i8*, i8** %7
store i8* %303, i8** %3
br label %304
304: ; preds = %302, %18, %12
%305 = load i8*, i8** %3
ret i8* %305
}

LLVM IR (-O2):
define i8* @libewf_convert_date_header_value(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = icmp eq i8* %0, null
br i1 %5, label %159, label %6
6: ; preds = %2
%7 = call i8** @libewf_split_string(i8* %0, i8 signext 32, i32* %3)
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 6
br i1 %9, label %10, label %159
10: ; preds = %6
%11 = call i8* @libewf_header_value_string_alloc(i32 20)
switch i32 %1, label %76 [
i32 2, label %12
i32 1, label %42
]
12: ; preds = %10
%13 = getelementptr inbounds i8*, i8** %7, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @strlen(i8* %14)
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %19
17: ; preds = %12
store i8 48, i8* %11
%18 = load i8*, i8** %13
br label %24
19: ; preds = %12
%20 = load i8*, i8** %13
%21 = load i8, i8* %20
store i8 %21, i8* %11
%22 = load i8*, i8** %13
%23 = getelementptr inbounds i8, i8* %22, i64 1
br label %24
24: ; preds = %19, %17
%25 = phi i8* [ %18, %17 ], [ %23, %19 ]
%26 = load i8, i8* %25
%27 = getelementptr inbounds i8, i8* %11, i64 1
store i8 %26, i8* %27
%28 = getelementptr inbounds i8, i8* %11, i64 2
store i8 47, i8* %28
%29 = getelementptr inbounds i8*, i8** %7, i64 2
%30 = load i8*, i8** %29
%31 = call i32 @strlen(i8* %30)
%32 = icmp eq i32 %31, 1
br i1 %32, label %33, label %36
33: ; preds = %24
%34 = getelementptr inbounds i8, i8* %11, i64 3
store i8 48, i8* %34
%35 = load i8*, i8** %29
br label %72
36: ; preds = %24
%37 = load i8*, i8** %29
%38 = load i8, i8* %37
%39 = getelementptr inbounds i8, i8* %11, i64 3
store i8 %38, i8* %39
%40 = load i8*, i8** %29
%41 = getelementptr inbounds i8, i8* %40, i64 1
br label %72
42: ; preds = %10
%43 = getelementptr inbounds i8*, i8** %7, i64 2
%44 = load i8*, i8** %43
%45 = call i32 @strlen(i8* %44)
%46 = icmp eq i32 %45, 1
br i1 %46, label %47, label %49
47: ; preds = %42
store i8 48, i8* %11
%48 = load i8*, i8** %43
br label %54
49: ; preds = %42
%50 = load i8*, i8** %43
%51 = load i8, i8* %50
store i8 %51, i8* %11
%52 = load i8*, i8** %43
%53 = getelementptr inbounds i8, i8* %52, i64 1
br label %54
54: ; preds = %49, %47
%55 = phi i8* [ %48, %47 ], [ %53, %49 ]
%56 = load i8, i8* %55
%57 = getelementptr inbounds i8, i8* %11, i64 1
store i8 %56, i8* %57
%58 = getelementptr inbounds i8, i8* %11, i64 2
store i8 47, i8* %58
%59 = getelementptr inbounds i8*, i8** %7, i64 1
%60 = load i8*, i8** %59
%61 = call i32 @strlen(i8* %60)
%62 = icmp eq i32 %61, 1
br i1 %62, label %63, label %66
63: ; preds = %54
%64 = getelementptr inbounds i8, i8* %11, i64 3
store i8 48, i8* %64
%65 = load i8*, i8** %59
br label %72
66: ; preds = %54
%67 = load i8*, i8** %59
%68 = load i8, i8* %67
%69 = getelementptr inbounds i8, i8* %11, i64 3
store i8 %68, i8* %69
%70 = load i8*, i8** %59
%71 = getelementptr inbounds i8, i8* %70, i64 1
br label %72
72: ; preds = %36, %33, %63, %66
%73 = phi i8* [ %71, %66 ], [ %65, %63 ], [ %35, %33 ], [ %41, %36 ]
%74 = load i8, i8* %73
%75 = getelementptr inbounds i8, i8* %11, i64 4
store i8 %74, i8* %75
br label %76
76: ; preds = %72, %10
%77 = getelementptr inbounds i8, i8* %11, i64 5
store i8 47, i8* %77
%78 = load i8*, i8** %7
%79 = load i8, i8* %78
%80 = getelementptr inbounds i8, i8* %11, i64 6
store i8 %79, i8* %80
%81 = load i8*, i8** %7
%82 = getelementptr inbounds i8, i8* %81, i64 1
%83 = load i8, i8* %82
%84 = getelementptr inbounds i8, i8* %11, i64 7
store i8 %83, i8* %84
%85 = load i8*, i8** %7
%86 = getelementptr inbounds i8, i8* %85, i64 2
%87 = load i8, i8* %86
%88 = getelementptr inbounds i8, i8* %11, i64 8
store i8 %87, i8* %88
%89 = load i8*, i8** %7
%90 = getelementptr inbounds i8, i8* %89, i64 3
%91 = load i8, i8* %90
%92 = getelementptr inbounds i8, i8* %11, i64 9
store i8 %91, i8* %92
%93 = getelementptr inbounds i8, i8* %11, i64 10
store i8 32, i8* %93
%94 = getelementptr inbounds i8*, i8** %7, i64 3
%95 = load i8*, i8** %94
%96 = call i32 @strlen(i8* %95)
%97 = icmp eq i32 %96, 1
br i1 %97, label %98, label %101
98: ; preds = %76
%99 = getelementptr inbounds i8, i8* %11, i64 11
store i8 48, i8* %99
%100 = load i8*, i8** %94
br label %107
101: ; preds = %76
%102 = load i8*, i8** %94
%103 = load i8, i8* %102
%104 = getelementptr inbounds i8, i8* %11, i64 11
store i8 %103, i8* %104
%105 = load i8*, i8** %94
%106 = getelementptr inbounds i8, i8* %105, i64 1
br label %107
107: ; preds = %101, %98
%108 = phi i8* [ %100, %98 ], [ %106, %101 ]
%109 = load i8, i8* %108
%110 = getelementptr inbounds i8, i8* %11, i64 12
store i8 %109, i8* %110
%111 = getelementptr inbounds i8, i8* %11, i64 13
store i8 58, i8* %111
%112 = getelementptr inbounds i8*, i8** %7, i64 4
%113 = load i8*, i8** %112
%114 = call i32 @strlen(i8* %113)
%115 = icmp eq i32 %114, 1
br i1 %115, label %116, label %119
116: ; preds = %107
%117 = getelementptr inbounds i8, i8* %11, i64 14
store i8 48, i8* %117
%118 = load i8*, i8** %112
br label %125
119: ; preds = %107
%120 = load i8*, i8** %112
%121 = load i8, i8* %120
%122 = getelementptr inbounds i8, i8* %11, i64 14
store i8 %121, i8* %122
%123 = load i8*, i8** %112
%124 = getelementptr inbounds i8, i8* %123, i64 1
br label %125
125: ; preds = %119, %116
%126 = phi i8* [ %118, %116 ], [ %124, %119 ]
%127 = load i8, i8* %126
%128 = getelementptr inbounds i8, i8* %11, i64 15
store i8 %127, i8* %128
%129 = getelementptr inbounds i8, i8* %11, i64 16
store i8 58, i8* %129
%130 = getelementptr inbounds i8*, i8** %7, i64 5
%131 = load i8*, i8** %130
%132 = call i32 @strlen(i8* %131)
%133 = icmp eq i32 %132, 1
br i1 %133, label %134, label %137
134: ; preds = %125
%135 = getelementptr inbounds i8, i8* %11, i64 17
store i8 48, i8* %135
%136 = load i8*, i8** %130
br label %143
137: ; preds = %125
%138 = load i8*, i8** %130
%139 = load i8, i8* %138
%140 = getelementptr inbounds i8, i8* %11, i64 17
store i8 %139, i8* %140
%141 = load i8*, i8** %130
%142 = getelementptr inbounds i8, i8* %141, i64 1
br label %143
143: ; preds = %137, %134
%144 = phi i8* [ %136, %134 ], [ %142, %137 ]
%145 = load i8, i8* %144
%146 = getelementptr inbounds i8, i8* %11, i64 18
store i8 %145, i8* %146
%147 = getelementptr inbounds i8, i8* %11, i64 19
store i8 0, i8* %147
%148 = load i32, i32* %3
%149 = icmp sgt i32 %148, 0
br i1 %149, label %150, label %159
150: ; preds = %143, %150
%151 = phi i64 [ %155, %150 ], [ 0, %143 ]
%152 = getelementptr inbounds i8*, i8** %7, i64 %151
%153 = load i8*, i8** %152
%154 = call i32 @free(i8* %153)
%155 = add nuw nsw i64 %151, 1
%156 = load i32, i32* %3
%157 = sext i32 %156 to i64
%158 = icmp slt i64 %155, %157
br i1 %158, label %150, label %159
159: ; preds = %150, %143, %6, %2
%160 = phi i8* [ null, %2 ], [ null, %6 ], [ %11, %143 ], [ %11, %150 ]
ret i8* %160
}