#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, long, int, int, int, int /*<<< orphan*/,
                          char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ strlen(char *);
void PlaceText(long id, int x, int y, int mode, char *text) {
  printf("\033GT%ld;%d;%d;%d;%d:%s", id, x, y, mode, strlen(text), text);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<PlaceText>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x38(%rbp),%rsi
mov    -0x2c(%rbp),%edx
mov    -0x28(%rbp),%ecx
mov    -0x24(%rbp),%r8d
mov    %eax,%r9d
mov    -0x20(%rbp),%rax
lea    0xe78(%rip),%rdi
mov    %rax,(%rsp)
call   1040 <printf@plt>
mov    0x2e48(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PlaceText>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %r8,%rbx
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%r12d
mov    %rdi,%rbp
mov    %r8,%rdi
call   1030 <strlen@plt>
mov    %rbx,(%rsp)
lea    0xea2(%rip),%rdi
mov    %rbp,%rsi
mov    %r12d,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
mov    %eax,%r9d
call   1040 <printf@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <fflush@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"\1BGT%ld;%d;%d;%d;%d:%s\00"
@stdout = global i32 0
define void @PlaceText(i64 %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
store i64 %0, i64* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i64, i64* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i8*, i8** %10
%16 = call i32 @strlen(i8* %15)
%17 = load i8*, i8** %10
%18 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 %11, i32 %12, i32 %13, i32 %14, i32 %16, i8* %17)
%19 = load i32, i32* @stdout
%20 = call i32 @fflush(i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"\1BGT%ld;%d;%d;%d;%d:%s\00"
@stdout = global i32 0
define void @PlaceText(i64 %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = tail call i32 @strlen(i8* %4)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 %0, i32 %1, i32 %2, i32 %3, i32 %6, i8* %4)
%8 = load i32, i32* @stdout
%9 = tail call i32 @fflush(i32 %8)
ret void
}