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

/* Variables and functions */
int /*<<< orphan*/ kannotate_write(char const *, int);
int strlen(char const *);
void gator_annotate_marker_color_str(int color, const char *str) {
  int str_size = (strlen(str) + 4) & 0xffff;
  long long header =
      0x1c | (0x05 << 8) | (str_size << 16) | ((long long)color << 32);
  kannotate_write((char *)&header, sizeof(header));
  kannotate_write(str, str_size - 4);
}


x86 assembly (clang, -O0):
<gator_annotate_marker_color_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x4,%eax
and    $0xffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x10,%eax
or     $0x51c,%eax
cltq
movslq -0x4(%rbp),%rcx
shl    $0x20,%rcx
or     %rcx,%rax
mov    %rax,-0x20(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x8,%esi
call   1040 <kannotate_write@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
sub    $0x4,%esi
call   1040 <kannotate_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gator_annotate_marker_color_str>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %edi,%ebx
mov    %rsi,%rdi
call   1030 <strlen@plt>
add    $0x4,%eax
movzwl %ax,%ebp
shl    $0x10,%eax
or     $0x51c,%eax
cltq
shl    $0x20,%rbx
or     %rax,%rbx
mov    %rbx,0x8(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x8,%esi
call   1040 <kannotate_write@plt>
add    $0xfffffffc,%ebp
mov    %r14,%rdi
mov    %ebp,%esi
call   1040 <kannotate_write@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @gator_annotate_marker_color_str(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
store i32 %0, i32* %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = add nsw i32 %8, 4
%10 = and i32 %9, 65535
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = shl i32 %11, 16
%13 = or i32 1308, %12
%14 = sext i32 %13 to i64
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = shl i64 %16, 32
%18 = or i64 %14, %17
store i64 %18, i64* %6
%19 = bitcast i64* %6 to i8*
%20 = call i32 @kannotate_write(i8* %19, i32 8)
%21 = load i8*, i8** %4
%22 = load i32, i32* %5
%23 = sub nsw i32 %22, 4
%24 = call i32 @kannotate_write(i8* %21, i32 %23)
ret void
}

LLVM IR (-O2):
define void @gator_annotate_marker_color_str(i32 %0, i8* %1) {
%3 = alloca i64
%4 = tail call i32 @strlen(i8* %1)
%5 = add nsw i32 %4, 4
%6 = and i32 %5, 65535
%7 = bitcast i64* %3 to i8*
%8 = shl i32 %5, 16
%9 = or i32 %8, 1308
%10 = sext i32 %9 to i64
%11 = zext i32 %0 to i64
%12 = shl nuw i64 %11, 32
%13 = or i64 %12, %10
store i64 %13, i64* %3
%14 = call i32 @kannotate_write(i8* %7, i32 8)
%15 = add nsw i32 %6, -4
%16 = call i32 @kannotate_write(i8* %1, i32 %15)
ret void
}