#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*/ LogDateTime();
int /*<<< orphan*/ printf(char *, char *, int, int);
void LogMessageAddress(int status, char *message, int address, int data) {
  LogDateTime();
  if (!status)
    printf("%s on %#02x to %#02x: error.\n", message, address, data);
  else
    printf("%s on %#02x to %#02x: done.\n", message, address, data);
}


x86 assembly (clang, -O0):
<LogMessageAddress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    $0x0,%al
call   1040 <LogDateTime@plt>
cmpl   $0x0,-0x4(%rbp)
jne    1161 <LogMessageAddress+0x41>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
jmp    1177 <LogMessageAddress+0x57>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LogMessageAddress>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <LogDateTime@plt>
test   %ebp,%ebp
lea    0xebe(%rip),%rax
lea    0xed5(%rip),%rdi
cmove  %rax,%rdi
mov    %rbx,%rsi
mov    %r15d,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"%s on %x to %x: error.\0A\00"
@.str.1 = [29 x i8] c"%s on %x to %x: done.\0A\00"
define void @LogMessageAddress(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = call i32 (...) @LogDateTime()
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
br i1 %11, label %17, label %12
12: ; preds = %4
%13 = load i8*, i8** %6
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %14, i32 %15)
br label %22
17: ; preds = %4
%18 = load i8*, i8** %6
%19 = load i32, i32* %7
%20 = load i32, i32* %8
%21 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* %18, i32 %19, i32 %20)
br label %22
22: ; preds = %17, %12
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"%s on %x to %x: error.\0A\00"
@.str.1 = [29 x i8] c"%s on %x to %x: done.\0A\00"
define void @LogMessageAddress(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 (...) @LogDateTime()
%6 = icmp eq i32 %0, 0
%7 = select i1 %6, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0)
%8 = tail call i32 @printf(i8* %7, i8* %1, i32 %2, i32 %3)
ret void
}