#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 /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ ERRORMESSAGE(char const *, char const *, char const *,
                                char const *);
char *asctime(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
char *szCat(char const *, char const *, char const *, char const *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void cmaes_FATAL(char const *s1, char const *s2, char const *s3,
                 char const *s4) {
  time_t t = time(NULL);
  ERRORMESSAGE(s1, s2, s3, s4);
  ERRORMESSAGE("*** Exiting cmaes_t ***", 0, 0, 0);
  printf("\n -- %s %s\n", asctime(localtime(&t)),
         s2 ? szCat(s1, s2, s3, s4) : s1);
  printf(" *** CMA-ES ABORTED, see errcmaes.err *** \n");
  fflush(stdout);
  exit(1);
}


x86 assembly (clang, -O0):
<cmaes_FATAL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1070 <time@plt>
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   10a0 <ERRORMESSAGE@plt>
lea    0xe40(%rip),%rdi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rsi
mov    %rcx,%rdx
call   10a0 <ERRORMESSAGE@plt>
lea    -0x24(%rbp),%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1040 <asctime@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     120c <cmaes_FATAL+0x8c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1060 <szCat@plt>
mov    %rax,-0x38(%rbp)
jmp    1214 <cmaes_FATAL+0x94>
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
lea    0xdf5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xdf3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2da1(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
mov    $0x1,%edi
call   1090 <exit@plt>

x86 assembly (clang, -O2):
<cmaes_FATAL>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r12
xor    %edi,%edi
call   1080 <time@plt>
mov    %eax,0xc(%rsp)
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   10b0 <ERRORMESSAGE@plt>
lea    0xe34(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   10b0 <ERRORMESSAGE@plt>
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1050 <asctime@plt>
mov    %rax,%r13
test   %rbx,%rbx
je     1204 <cmaes_FATAL+0x74>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1070 <szCat@plt>
mov    %rax,%r12
lea    0xe0d(%rip),%rdi
mov    %r13,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe05(%rip),%rdi
call   1040 <puts@plt>
mov    0x2db5(%rip),%rax
mov    (%rax),%edi
call   1090 <fflush@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"*** Exiting cmaes_t ***\00"
@.str.1 = [12 x i8] c"\0A -- %s %s\0A\00"
@.str.2 = [44 x i8] c" *** CMA-ES ABORTED, see errcmaes.err *** \0A\00"
@stdout = global i32 0
define void @cmaes_FATAL(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = call i32 @time(i32* null)
store i32 %10, i32* %9
%11 = load i8*, i8** %5
%12 = load i8*, i8** %6
%13 = load i8*, i8** %7
%14 = load i8*, i8** %8
%15 = call i32 @ERRORMESSAGE(i8* %11, i8* %12, i8* %13, i8* %14)
%16 = call i32 @ERRORMESSAGE(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* null, i8* null, i8* null)
%17 = call i32 @localtime(i32* %9)
%18 = call i8* @asctime(i32 %17)
%19 = load i8*, i8** %6
%20 = icmp ne i8* %19, null
br i1 %20, label %21, label %27
21: ; preds = %4
%22 = load i8*, i8** %5
%23 = load i8*, i8** %6
%24 = load i8*, i8** %7
%25 = load i8*, i8** %8
%26 = call i8* @szCat(i8* %22, i8* %23, i8* %24, i8* %25)
br label %29
27: ; preds = %4
%28 = load i8*, i8** %5
br label %29
29: ; preds = %27, %21
%30 = phi i8* [ %26, %21 ], [ %28, %27 ]
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %18, i8* %30)
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
%33 = load i32, i32* @stdout
%34 = call i32 @fflush(i32 %33)
%35 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [24 x i8] c"*** Exiting cmaes_t ***\00"
@.str.1 = [12 x i8] c"\0A -- %s %s\0A\00"
@stdout = global i32 0
@str = [43 x i8] c" *** CMA-ES ABORTED, see errcmaes.err *** \00"
define void @cmaes_FATAL(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = bitcast i32* %5 to i8*
%7 = tail call i32 @time(i32* null)
store i32 %7, i32* %5
%8 = tail call i32 @ERRORMESSAGE(i8* %0, i8* %1, i8* %2, i8* %3)
%9 = tail call i32 @ERRORMESSAGE(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* null, i8* null, i8* null)
%10 = call i32 @localtime(i32* %5)
%11 = call i8* @asctime(i32 %10)
%12 = icmp eq i8* %1, null
br i1 %12, label %15, label %13
13: ; preds = %4
%14 = call i8* @szCat(i8* %0, i8* %1, i8* %2, i8* %3)
br label %15
15: ; preds = %4, %13
%16 = phi i8* [ %14, %13 ], [ %0, %4 ]
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %11, i8* %16)
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%19 = load i32, i32* @stdout
%20 = call i32 @fflush(i32 %19)
%21 = call i32 @exit(i32 1)
unreachable
}