#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 */
char *strcat(char *, char *);
char *dhnfe(int tzd, int hverao, char **str) {
  char *aux;
  if (hverao == 1) {
    switch (tzd) {
    case -2:
      aux = "2:00";
      break;
    case -3:
    default:
      aux = "3:00";
      break;
    case -4:
      aux = "4:00";
      break;
    }
  } else if (hverao == 0) {
    switch (tzd) {
    case -2:
      aux = "1:00";
      break;
    case -3:
    default:
      aux = "2:00";
      break;
    case -4:
      aux = "3:00";
      break;
    }
  }
  strcat(*str, "%Y-%m-%d-T-%H:%M:%S-");
  return strcat(*str, aux);
}


x86 assembly (clang, -O0):
<dhnfe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1197 <dhnfe+0x87>
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0xfffffffc,%eax
je     1187 <dhnfe+0x77>
jmp    1140 <dhnfe+0x30>
mov    -0x1c(%rbp),%eax
sub    $0xfffffffd,%eax
je     1172 <dhnfe+0x62>
jmp    1151 <dhnfe+0x41>
mov    -0x1c(%rbp),%eax
sub    $0xfffffffe,%eax
jne    1177 <dhnfe+0x67>
jmp    1162 <dhnfe+0x52>
lea    0xe97(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1192 <dhnfe+0x82>
jmp    1177 <dhnfe+0x67>
lea    0xe87(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1192 <dhnfe+0x82>
lea    0xe7c(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1211 <dhnfe+0x101>
cmpl   $0x0,-0x8(%rbp)
jne    120c <dhnfe+0xfc>
mov    -0x4(%rbp),%eax
mov    %eax,-0x20(%rbp)
sub    $0xfffffffc,%eax
je     11fc <dhnfe+0xec>
jmp    11b5 <dhnfe+0xa5>
mov    -0x20(%rbp),%eax
sub    $0xfffffffd,%eax
je     11e7 <dhnfe+0xd7>
jmp    11c6 <dhnfe+0xb6>
mov    -0x20(%rbp),%eax
sub    $0xfffffffe,%eax
jne    11ec <dhnfe+0xdc>
jmp    11d7 <dhnfe+0xc7>
lea    0xe31(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1207 <dhnfe+0xf7>
jmp    11ec <dhnfe+0xdc>
lea    0xe0d(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1207 <dhnfe+0xf7>
lea    0xe02(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    120c <dhnfe+0xfc>
jmp    1211 <dhnfe+0x101>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xdf5(%rip),%rsi
call   1030 <strcat@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dhnfe>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
cmp    $0x1,%esi
jne    113e <dhnfe+0x2e>
cmp    $0xfffffffc,%edi
lea    0xee3(%rip),%rax
lea    0xed7(%rip),%rcx
cmove  %rax,%rcx
cmp    $0xfffffffe,%edi
lea    0xec4(%rip),%r15
jmp    115d <dhnfe+0x4d>
cmp    $0xfffffffc,%edi
lea    0xebd(%rip),%rax
lea    0xeb1(%rip),%rcx
cmove  %rax,%rcx
cmp    $0xfffffffe,%edi
lea    0xeb2(%rip),%r15
cmovne %rcx,%r15
mov    (%r14),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
movabs $0x2d53253a4d253a,%rcx
mov    %rcx,0xd(%rbx,%rax,1)
movups 0xe92(%rip),%xmm0
movups %xmm0,(%rbx,%rax,1)
mov    (%r14),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    (%r15),%ecx
mov    %ecx,(%rbx,%rax,1)
mov    0x4(%r15),%cl
mov    %cl,0x4(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"2:00\00"
@.str.1 = [5 x i8] c"3:00\00"
@.str.2 = [5 x i8] c"4:00\00"
@.str.3 = [5 x i8] c"1:00\00"
@.str.4 = [21 x i8] c"%Y-%m-%d-T-%H:%M:%S-\00"
define i8* @dhnfe(i32 %0, i32 %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %17
10: ; preds = %3
%11 = load i32, i32* %4
switch i32 %11, label %14 [
i32 -2, label %12
i32 -3, label %13
i32 -4, label %15
]
12: ; preds = %10
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %7
br label %16
13: ; preds = %10
br label %14
14: ; preds = %10, %13
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %7
br label %16
15: ; preds = %10
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8** %7
br label %16
16: ; preds = %15, %14, %12
br label %28
17: ; preds = %3
%18 = load i32, i32* %5
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %27
20: ; preds = %17
%21 = load i32, i32* %4
switch i32 %21, label %24 [
i32 -2, label %22
i32 -3, label %23
i32 -4, label %25
]
22: ; preds = %20
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8** %7
br label %26
23: ; preds = %20
br label %24
24: ; preds = %20, %23
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %7
br label %26
25: ; preds = %20
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %7
br label %26
26: ; preds = %25, %24, %22
br label %27
27: ; preds = %26, %17
br label %28
28: ; preds = %27, %16
%29 = load i8**, i8*** %6
%30 = load i8*, i8** %29
%31 = call i8* @strcat(i8* %30, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
%32 = load i8**, i8*** %6
%33 = load i8*, i8** %32
%34 = load i8*, i8** %7
%35 = call i8* @strcat(i8* %33, i8* %34)
ret i8* %35
}

LLVM IR (-O2):
@.str = [5 x i8] c"2:00\00"
@.str.1 = [5 x i8] c"3:00\00"
@.str.2 = [5 x i8] c"4:00\00"
@.str.3 = [5 x i8] c"1:00\00"
@.str.4 = [21 x i8] c"%Y-%m-%d-T-%H:%M:%S-\00"
define i8* @dhnfe(i32 %0, i32 %1, i8** nocapture %2) {
%4 = icmp eq i32 %1, 1
%5 = icmp eq i32 %0, -4
br i1 %4, label %6, label %10
6: ; preds = %3
%7 = select i1 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
%8 = icmp eq i32 %0, -2
%9 = select i1 %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %7
br label %14
10: ; preds = %3
%11 = select i1 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
%12 = icmp eq i32 %0, -2
%13 = select i1 %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %11
br label %14
14: ; preds = %10, %6
%15 = phi i8* [ %9, %6 ], [ %13, %10 ]
%16 = load i8*, i8** %2
%17 = tail call i64 @strlen(i8* dereferenceable(1) %16)
%18 = getelementptr i8, i8* %16, i64 %17
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(21) %18, i8* align 1 dereferenceable(21) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i64 21, i1 false)
%19 = load i8*, i8** %2
%20 = tail call i64 @strlen(i8* dereferenceable(1) %19)
%21 = getelementptr i8, i8* %19, i64 %20
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(5) %21, i8* align 1 dereferenceable(5) %15, i64 5, i1 false)
ret i8* %19
}