#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*/ getTimeStamp(char *);
int /*<<< orphan*/ memcpy(char *, char const *, int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *, char *,
                           char const *);
int /*<<< orphan*/ writeTrace(char *);
void traceData(const char *pComponent, const char *pCaller,
               const char *pMessType, const char *pParm) {
  char component[12];
  char timeStamp[20];
  char messageType[12];
  char buff[20 + 12 + 12 + 20 + 2 + 256];
  char callerBuf[20];
  memset(timeStamp, 0, sizeof(char) * 20);
  memset(messageType, 0, sizeof(char) * 12);
  memset(component, 0, sizeof(char) * 12);
  memset(buff, 0, sizeof(char) * 20 + 12 + 12 + 20 + 2 + 256);
  memset(callerBuf, 0, sizeof(char) * 20);
  memcpy(messageType, pMessType, sizeof(char) * (12 - 1));
  memcpy(component, pComponent, sizeof(char) * (12 - 1));
  memcpy(callerBuf, pCaller, sizeof(char) * (20 - 1));
  getTimeStamp(timeStamp);
  sprintf(buff, "%s %s %s %s() %s", timeStamp, messageType, component,
          callerBuf, pParm);
  writeTrace(buff);
}


x86 assembly (clang, -O0):
<traceData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1030 <memset@plt>
lea    -0x4c(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1030 <memset@plt>
lea    -0x2c(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1030 <memset@plt>
lea    -0x190(%rbp),%rdi
xor    %esi,%esi
mov    $0x142,%edx
call   1030 <memset@plt>
lea    -0x1b0(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1030 <memset@plt>
lea    -0x4c(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0xb,%edx
call   1050 <memcpy@plt>
lea    -0x2c(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0xb,%edx
call   1050 <memcpy@plt>
lea    -0x1b0(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x13,%edx
call   1050 <memcpy@plt>
lea    -0x40(%rbp),%rdi
call   1040 <getTimeStamp@plt>
lea    -0x190(%rbp),%rdi
lea    -0x40(%rbp),%rdx
lea    -0x4c(%rbp),%rcx
lea    -0x2c(%rbp),%r8
lea    -0x1b0(%rbp),%r9
mov    -0x20(%rbp),%rax
lea    0xdd8(%rip),%rsi
mov    %rax,(%rsp)
call   1070 <sprintf@plt>
lea    -0x190(%rbp),%rdi
call   1060 <writeTrace@plt>
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<traceData>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1b8,%rsp
mov    %rcx,0x18(%rsp)
mov    %rdx,%r15
mov    %rsi,0x10(%rsp)
mov    %rdi,%r14
lea    0x20(%rsp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1030 <memset@plt>
lea    0x38(%rsp),%r13
mov    %r13,%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1030 <memset@plt>
lea    0x44(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1030 <memset@plt>
lea    0x70(%rsp),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x142,%edx
call   1030 <memset@plt>
lea    0x50(%rsp),%r12
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1030 <memset@plt>
mov    %r13,%rdi
mov    %r15,%rsi
mov    $0xb,%edx
call   1050 <memcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xb,%edx
call   1050 <memcpy@plt>
mov    %r12,%rdi
mov    0x10(%rsp),%rsi
mov    $0x13,%edx
call   1050 <memcpy@plt>
lea    0x20(%rsp),%rdi
call   1040 <getTimeStamp@plt>
mov    0x18(%rsp),%rax
mov    %rax,(%rsp)
lea    0xde2(%rip),%rsi
mov    %rbp,%rdi
lea    0x20(%rsp),%rdx
mov    %r13,%rcx
mov    %rbx,%r8
mov    %r12,%r9
call   1070 <sprintf@plt>
mov    %rbp,%rdi
call   1060 <writeTrace@plt>
add    $0x1b8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"%s %s %s %s() %s\00"
define void @traceData(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca [12 x i8]
%10 = alloca [20 x i8]
%11 = alloca [12 x i8]
%12 = alloca [322 x i8]
%13 = alloca [20 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%14 = getelementptr inbounds [20 x i8], [20 x i8]* %10, i64 0, i64 0
%15 = call i32 @memset(i8* %14, i32 0, i32 20)
%16 = getelementptr inbounds [12 x i8], [12 x i8]* %11, i64 0, i64 0
%17 = call i32 @memset(i8* %16, i32 0, i32 12)
%18 = getelementptr inbounds [12 x i8], [12 x i8]* %9, i64 0, i64 0
%19 = call i32 @memset(i8* %18, i32 0, i32 12)
%20 = getelementptr inbounds [322 x i8], [322 x i8]* %12, i64 0, i64 0
%21 = call i32 @memset(i8* %20, i32 0, i32 322)
%22 = getelementptr inbounds [20 x i8], [20 x i8]* %13, i64 0, i64 0
%23 = call i32 @memset(i8* %22, i32 0, i32 20)
%24 = getelementptr inbounds [12 x i8], [12 x i8]* %11, i64 0, i64 0
%25 = load i8*, i8** %7
%26 = call i32 @memcpy(i8* %24, i8* %25, i32 11)
%27 = getelementptr inbounds [12 x i8], [12 x i8]* %9, i64 0, i64 0
%28 = load i8*, i8** %5
%29 = call i32 @memcpy(i8* %27, i8* %28, i32 11)
%30 = getelementptr inbounds [20 x i8], [20 x i8]* %13, i64 0, i64 0
%31 = load i8*, i8** %6
%32 = call i32 @memcpy(i8* %30, i8* %31, i32 19)
%33 = getelementptr inbounds [20 x i8], [20 x i8]* %10, i64 0, i64 0
%34 = call i32 @getTimeStamp(i8* %33)
%35 = getelementptr inbounds [322 x i8], [322 x i8]* %12, i64 0, i64 0
%36 = getelementptr inbounds [20 x i8], [20 x i8]* %10, i64 0, i64 0
%37 = getelementptr inbounds [12 x i8], [12 x i8]* %11, i64 0, i64 0
%38 = getelementptr inbounds [12 x i8], [12 x i8]* %9, i64 0, i64 0
%39 = getelementptr inbounds [20 x i8], [20 x i8]* %13, i64 0, i64 0
%40 = load i8*, i8** %8
%41 = call i32 @sprintf(i8* %35, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %36, i8* %37, i8* %38, i8* %39, i8* %40)
%42 = getelementptr inbounds [322 x i8], [322 x i8]* %12, i64 0, i64 0
%43 = call i32 @writeTrace(i8* %42)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"%s %s %s %s() %s\00"
define void @traceData(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca [12 x i8]
%6 = alloca [20 x i8]
%7 = alloca [12 x i8]
%8 = alloca [322 x i8]
%9 = alloca [20 x i8]
%10 = getelementptr inbounds [12 x i8], [12 x i8]* %5, i64 0, i64 0
%11 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%12 = getelementptr inbounds [12 x i8], [12 x i8]* %7, i64 0, i64 0
%13 = getelementptr inbounds [322 x i8], [322 x i8]* %8, i64 0, i64 0
%14 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 0
%15 = call i32 @memset(i8* %11, i32 0, i32 20)
%16 = call i32 @memset(i8* %12, i32 0, i32 12)
%17 = call i32 @memset(i8* %10, i32 0, i32 12)
%18 = call i32 @memset(i8* %13, i32 0, i32 322)
%19 = call i32 @memset(i8* %14, i32 0, i32 20)
%20 = call i32 @memcpy(i8* %12, i8* %2, i32 11)
%21 = call i32 @memcpy(i8* %10, i8* %0, i32 11)
%22 = call i32 @memcpy(i8* %14, i8* %1, i32 19)
%23 = call i32 @getTimeStamp(i8* %11)
%24 = call i32 @sprintf(i8* %13, i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12, i8* %10, i8* %14, i8* %3)
%25 = call i32 @writeTrace(i8* %13)
ret void
}