#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 get_mutant_hex_value(char const *, int);
int /*<<< orphan*/ printf(char *, ...);
int main(const int argc, const char **argv) {
  const char *id = argv[1];
  const int ymd = get_mutant_hex_value(id, 3);
  const int hms = get_mutant_hex_value(id + 3, 3);
  const int millisec = get_mutant_hex_value(id + 6, 2);
  const int year = ymd / (31 * 12) + 1800;
  const int month = (ymd / 31) % 12 + 1;
  const int day = ymd % 31 + 1;
  assert(argc == 2);
  printf("%04d-%02d-%02d %02d:%02d:%02d.%03d", year, month, day, hms / 3600,
         (hms / 60) % 60, hms % 60, millisec);
  printf("_%.8s_%.2s\n", id + 8, id + 16);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x3,%esi
call   1050 <get_mutant_hex_value@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x3,%rdi
mov    $0x3,%esi
call   1050 <get_mutant_hex_value@plt>
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x6,%rdi
mov    $0x2,%esi
call   1050 <get_mutant_hex_value@plt>
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x174,%ecx
cltd
idiv   %ecx
add    $0x708,%eax
mov    %eax,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x1f,%ecx
cltd
idiv   %ecx
mov    $0xc,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x2c(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x1f,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x30(%rbp)
cmpl   $0x2,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x28(%rbp),%esi
mov    -0x2c(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x30(%rbp),%ecx
mov    -0x20(%rbp),%eax
mov    $0xe10,%edi
cltd
idiv   %edi
mov    %eax,%r8d
mov    -0x20(%rbp),%eax
mov    $0x3c,%edi
cltd
idiv   %edi
mov    $0x3c,%edi
cltd
idiv   %edi
mov    %edx,%r9d
mov    -0x20(%rbp),%eax
mov    $0x3c,%edi
cltd
idiv   %edi
mov    %edx,%r10d
mov    -0x34(%rbp),%edx
mov    -0x24(%rbp),%eax
lea    0xdda(%rip),%rdi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
add    $0x8,%rsi
mov    -0x18(%rbp),%rdx
add    $0x10,%rdx
lea    0xdd7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %edi,%r12d
mov    0x8(%rsi),%r15
mov    %r15,%rdi
mov    $0x3,%esi
call   1050 <get_mutant_hex_value@plt>
mov    %eax,%ebp
lea    0x3(%r15),%rdi
mov    $0x3,%esi
call   1050 <get_mutant_hex_value@plt>
mov    %eax,%r13d
lea    0x6(%r15),%rdi
mov    $0x2,%esi
call   1050 <get_mutant_hex_value@plt>
mov    %rax,0x10(%rsp)
movslq %ebp,%rax
imul   $0x2c0b02c1,%rax,%rcx
mov    %rcx,%rdx
shr    $0x20,%rdx
sar    $0x6,%edx
shr    $0x3f,%rcx
add    %edx,%ecx
add    $0x708,%ecx
mov    %ecx,0xc(%rsp)
imul   $0xffffffff84210843,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x4,%ecx
add    %edx,%ecx
movslq %ecx,%rcx
imul   $0x2aaaaaab,%rcx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
shr    $0x21,%rdx
add    %esi,%edx
shl    $0x2,%edx
lea    (%rdx,%rdx,2),%edx
mov    %ecx,%ebp
sub    %edx,%ebp
add    $0x1,%ebp
mov    %ecx,%edx
shl    $0x5,%edx
sub    %edx,%ecx
lea    (%rax,%rcx,1),%r14d
add    $0x1,%r14d
xor    %edi,%edi
cmp    $0x2,%r12d
sete   %dil
call   1040 <assert@plt>
movslq %r13d,%rbx
imul   $0xffffffff91a2b3c5,%rbx,%r8
shr    $0x20,%r8
add    %ebx,%r8d
mov    %r8d,%eax
shr    $0x1f,%eax
sar    $0xb,%r8d
add    %eax,%r8d
imul   $0xffffffff88888889,%rbx,%rax
shr    $0x20,%rax
add    %ebx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x5,%eax
add    %ecx,%eax
movslq %eax,%r9
imul   $0xffffffff88888889,%r9,%rax
shr    $0x20,%rax
add    %r9d,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x5,%eax
add    %ecx,%eax
imul   $0x3c,%eax,%eax
imul   $0x3c,%r9d,%ecx
sub    %eax,%r9d
sub    %ecx,%ebx
lea    0xda8(%rip),%rdi
mov    0xc(%rsp),%esi
mov    %ebp,%edx
mov    %r14d,%ecx
xor    %eax,%eax
push   0x10(%rsp)
push   %rbx
call   1030 <printf@plt>
add    $0x10,%rsp
lea    0x8(%r15),%rsi
add    $0x10,%r15
lea    0xda3(%rip),%rdi
mov    %r15,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [35 x i8] c"%04d-%02d-%02d %02d:%02d:%02d.%03d\00"
@.str.1 = [12 x i8] c"_%.8s_%.2s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
store i8* %15, i8** %6
%16 = load i8*, i8** %6
%17 = call i32 @get_mutant_hex_value(i8* %16, i32 3)
store i32 %17, i32* %7
%18 = load i8*, i8** %6
%19 = getelementptr inbounds i8, i8* %18, i64 3
%20 = call i32 @get_mutant_hex_value(i8* %19, i32 3)
store i32 %20, i32* %8
%21 = load i8*, i8** %6
%22 = getelementptr inbounds i8, i8* %21, i64 6
%23 = call i32 @get_mutant_hex_value(i8* %22, i32 2)
store i32 %23, i32* %9
%24 = load i32, i32* %7
%25 = sdiv i32 %24, 372
%26 = add nsw i32 %25, 1800
store i32 %26, i32* %10
%27 = load i32, i32* %7
%28 = sdiv i32 %27, 31
%29 = srem i32 %28, 12
%30 = add nsw i32 %29, 1
store i32 %30, i32* %11
%31 = load i32, i32* %7
%32 = srem i32 %31, 31
%33 = add nsw i32 %32, 1
store i32 %33, i32* %12
%34 = load i32, i32* %4
%35 = icmp eq i32 %34, 2
%36 = zext i1 %35 to i32
%37 = call i32 @assert(i32 %36)
%38 = load i32, i32* %10
%39 = load i32, i32* %11
%40 = load i32, i32* %12
%41 = load i32, i32* %8
%42 = sdiv i32 %41, 3600
%43 = load i32, i32* %8
%44 = sdiv i32 %43, 60
%45 = srem i32 %44, 60
%46 = load i32, i32* %8
%47 = srem i32 %46, 60
%48 = load i32, i32* %9
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %38, i32 %39, i32 %40, i32 %42, i32 %45, i32 %47, i32 %48)
%50 = load i8*, i8** %6
%51 = getelementptr inbounds i8, i8* %50, i64 8
%52 = load i8*, i8** %6
%53 = getelementptr inbounds i8, i8* %52, i64 16
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %51, i8* %53)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"%04d-%02d-%02d %02d:%02d:%02d.%03d\00"
@.str.1 = [12 x i8] c"_%.8s_%.2s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @get_mutant_hex_value(i8* %4, i32 3)
%6 = getelementptr inbounds i8, i8* %4, i64 3
%7 = tail call i32 @get_mutant_hex_value(i8* %6, i32 3)
%8 = getelementptr inbounds i8, i8* %4, i64 6
%9 = tail call i32 @get_mutant_hex_value(i8* %8, i32 2)
%10 = sdiv i32 %5, 372
%11 = add nsw i32 %10, 1800
%12 = sdiv i32 %5, 31
%13 = srem i32 %12, 12
%14 = add nsw i32 %13, 1
%15 = srem i32 %5, 31
%16 = add nsw i32 %15, 1
%17 = icmp eq i32 %0, 2
%18 = zext i1 %17 to i32
%19 = tail call i32 @assert(i32 %18)
%20 = sdiv i32 %7, 3600
%21 = sdiv i32 %7, 60
%22 = srem i32 %21, 60
%23 = srem i32 %7, 60
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %14, i32 %16, i32 %20, i32 %22, i32 %23, i32 %9)
%25 = getelementptr inbounds i8, i8* %4, i64 8
%26 = getelementptr inbounds i8, i8* %4, i64 16
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %25, i8* %26)
ret i32 0
}