#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*/ free(char *);
int /*<<< orphan*/ printLog(char *, ...);
void processPayload(char *payloadCopy, int len, long timestamp) {
  unsigned char msgID = payloadCopy[0];
  printLog("Received frame ID: %d of length: %d\n", msgID, len);
  if (msgID == 0x29 && len == 91) {
    printLog("Geodetic OK !\n");
  }
  free(payloadCopy);
}


x86 assembly (clang, -O0):
<processPayload>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
movzbl -0x19(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1040 <printLog@plt>
movzbl -0x19(%rbp),%eax
cmp    $0x29,%eax
jne    1176 <processPayload+0x56>
cmpl   $0x5b,-0xc(%rbp)
jne    1176 <processPayload+0x56>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1040 <printLog@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processPayload>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    (%rdi),%bl
movzbl %bl,%esi
lea    0xecb(%rip),%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <printLog@plt>
cmp    $0x5b,%ebp
jne    1156 <processPayload+0x36>
cmp    $0x29,%bl
jne    1156 <processPayload+0x36>
lea    0xed6(%rip),%rdi
xor    %eax,%eax
call   1040 <printLog@plt>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"Received frame ID: %d of length: %d\0A\00"
@.str.1 = [15 x i8] c"Geodetic OK !\0A\00"
define void @processPayload(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
%7 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
store i8 %10, i8* %7
%11 = load i8, i8* %7
%12 = zext i8 %11 to i32
%13 = load i32, i32* %5
%14 = call i32 (i8*, ...) @printLog(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13)
%15 = load i8, i8* %7
%16 = zext i8 %15 to i32
%17 = icmp eq i32 %16, 41
br i1 %17, label %18, label %23
18: ; preds = %3
%19 = load i32, i32* %5
%20 = icmp eq i32 %19, 91
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = call i32 (i8*, ...) @printLog(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %23
23: ; preds = %21, %18, %3
%24 = load i8*, i8** %4
%25 = call i32 @free(i8* %24)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"Received frame ID: %d of length: %d\0A\00"
@.str.1 = [15 x i8] c"Geodetic OK !\0A\00"
define void @processPayload(i8* nocapture %0, i32 %1, i64 %2) {
%4 = load i8, i8* %0
%5 = zext i8 %4 to i32
%6 = tail call i32 (i8*, ...) @printLog(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %1)
%7 = icmp eq i8 %4, 41
%8 = icmp eq i32 %1, 91
%9 = and i1 %8, %7
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = tail call i32 (i8*, ...) @printLog(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %3
%13 = tail call i32 @free(i8* %0)
ret void
}