#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*/ kannotate_write(char *, unsigned int);
unsigned int strlen(char *);
void gator_annotate_visual(char *data, unsigned int length, char *string) {
  long long visual_annotation =
      0x011c | (strlen(string) << 16) | ((long long)length << 32);
  kannotate_write((char *)&visual_annotation, 8);
  kannotate_write(string, strlen(string));
  kannotate_write(data, length);
}


x86 assembly (clang, -O0):
<gator_annotate_visual>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
shl    $0x10,%eax
or     $0x11c,%eax
mov    %eax,%eax
mov    -0xc(%rbp),%ecx
shl    $0x20,%rcx
or     %rcx,%rax
mov    %rax,-0x20(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x8,%esi
call   1040 <kannotate_write@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
call   1040 <kannotate_write@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <kannotate_write@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gator_annotate_visual>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
mov    %esi,%r15d
mov    %rdi,%r14
mov    %rdx,%rdi
call   1030 <strlen@plt>
shl    $0x10,%eax
or     $0x11c,%eax
mov    %r15,%rcx
shl    $0x20,%rcx
or     %rax,%rcx
mov    %rcx,0x8(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x8,%esi
call   1040 <kannotate_write@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <kannotate_write@plt>
mov    %r14,%rdi
mov    %r15d,%esi
call   1040 <kannotate_write@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @gator_annotate_visual(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = call i32 @strlen(i8* %8)
%10 = shl i32 %9, 16
%11 = or i32 284, %10
%12 = zext i32 %11 to i64
%13 = load i32, i32* %5
%14 = zext i32 %13 to i64
%15 = shl i64 %14, 32
%16 = or i64 %12, %15
store i64 %16, i64* %7
%17 = bitcast i64* %7 to i8*
%18 = call i32 @kannotate_write(i8* %17, i32 8)
%19 = load i8*, i8** %6
%20 = load i8*, i8** %6
%21 = call i32 @strlen(i8* %20)
%22 = call i32 @kannotate_write(i8* %19, i32 %21)
%23 = load i8*, i8** %4
%24 = load i32, i32* %5
%25 = call i32 @kannotate_write(i8* %23, i32 %24)
ret void
}

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