#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 *getTimeInString();
int /*<<< orphan*/ printf(char *, ...);
void ogLogMacroBackEnd(char *category, char *message, char *filename,
                       unsigned int lineNumber) {
  char *timeInString = getTimeInString();
  if (category == NULL || message == NULL || filename == NULL ||
      timeInString == NULL) {
    printf(
        "Error: Failed to log error, but didn't fail to log log error error\n");
    return;
  }
  printf("%s: %s --- %s:%u --- %s \n", category, message, filename, lineNumber,
         timeInString);
}


x86 assembly (clang, -O0):
<ogLogMacroBackEnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    $0x0,%al
call   1040 <getTimeInString@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116e <ogLogMacroBackEnd+0x4e>
cmpq   $0x0,-0x10(%rbp)
je     116e <ogLogMacroBackEnd+0x4e>
cmpq   $0x0,-0x18(%rbp)
je     116e <ogLogMacroBackEnd+0x4e>
cmpq   $0x0,-0x28(%rbp)
jne    1181 <ogLogMacroBackEnd+0x61>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a3 <ogLogMacroBackEnd+0x83>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    -0x28(%rbp),%r9
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ogLogMacroBackEnd>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %rsi,%rbp
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <getTimeInString@plt>
test   %rbx,%rbx
je     1185 <ogLogMacroBackEnd+0x55>
test   %rbp,%rbp
je     1185 <ogLogMacroBackEnd+0x55>
test   %r15,%r15
je     1185 <ogLogMacroBackEnd+0x55>
test   %rax,%rax
je     1185 <ogLogMacroBackEnd+0x55>
lea    0xe9b(%rip),%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
mov    %r15,%rcx
mov    %r14d,%r8d
mov    %rax,%r9
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>
lea    0xe8e(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [68 x i8] c"Error: Failed to log error, but didn't fail to log log error error\0A\00"
@.str.1 = [26 x i8] c"%s: %s --- %s:%u --- %s \0A\00"
define void @ogLogMacroBackEnd(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = call i8* (...) @getTimeInString()
store i8* %10, i8** %9
%11 = load i8*, i8** %5
%12 = icmp eq i8* %11, null
br i1 %12, label %22, label %13
13: ; preds = %4
%14 = load i8*, i8** %6
%15 = icmp eq i8* %14, null
br i1 %15, label %22, label %16
16: ; preds = %13
%17 = load i8*, i8** %7
%18 = icmp eq i8* %17, null
br i1 %18, label %22, label %19
19: ; preds = %16
%20 = load i8*, i8** %9
%21 = icmp eq i8* %20, null
br i1 %21, label %22, label %24
22: ; preds = %19, %16, %13, %4
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
br label %31
24: ; preds = %19
%25 = load i8*, i8** %5
%26 = load i8*, i8** %6
%27 = load i8*, i8** %7
%28 = load i32, i32* %8
%29 = load i8*, i8** %9
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %25, i8* %26, i8* %27, i32 %28, i8* %29)
br label %31
31: ; preds = %24, %22
ret void
}

LLVM IR (-O2):
@.str.1 = [26 x i8] c"%s: %s --- %s:%u --- %s \0A\00"
@str = [67 x i8] c"Error: Failed to log error, but didn't fail to log log error error\00"
define void @ogLogMacroBackEnd(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i8* (...) @getTimeInString()
%6 = icmp eq i8* %0, null
%7 = icmp eq i8* %1, null
%8 = or i1 %6, %7
%9 = icmp eq i8* %2, null
%10 = or i1 %8, %9
%11 = icmp eq i8* %5, null
%12 = select i1 %10, i1 true, i1 %11
br i1 %12, label %13, label %15
13: ; preds = %4
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str, i64 0, i64 0))
br label %17
15: ; preds = %4
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %1, i8* %2, i32 %3, i8* %5)
br label %17
17: ; preds = %15, %13
ret void
}