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

/* Variables and functions */
int /*<<< orphan*/ cleanup(char *, int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
char *strdup(char *);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ x(char *);
long ptrace(void *request, pid_t pid, void *addr, void *data) {
  char *anti_debug_msg =
      strdup("\xba\x91\x90\xd9\x8a\xde\x8d\x9d\x8c\x9f\x8a\x9d\x96\xde\x8a\x96"
             "\x9b\xde\x89\x9f\x92\x92\x8d");
  x(anti_debug_msg);
  printf("%s\n", anti_debug_msg);
  cleanup(anti_debug_msg, strlen(anti_debug_msg));
  exit(-1);
}


x86 assembly (clang, -O0):
<ptrace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xe82(%rip),%rdi
call   1080 <strdup@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <x@plt>
mov    -0x28(%rbp),%rsi
lea    0xe7d(%rip),%rdi
call   1050 <printf@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    %eax,%esi
call   1060 <cleanup@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<ptrace>:
push   %rbx
lea    0xe98(%rip),%rdi
call   1080 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <x@plt>
lea    0xe99(%rip),%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1060 <cleanup@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"\BA\91\90\D9\8A\DE\8D\9D\8C\9F\8A\9D\96\DE\8A\96\9B\DE\89\9F\92\92\8D\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i64 @ptrace(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = call i8* @strdup(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
store i8* %10, i8** %9
%11 = load i8*, i8** %9
%12 = call i32 @x(i8* %11)
%13 = load i8*, i8** %9
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%15 = load i8*, i8** %9
%16 = load i8*, i8** %9
%17 = call i32 @strlen(i8* %16)
%18 = call i32 @cleanup(i8* %15, i32 %17)
%19 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [24 x i8] c"\BA\91\90\D9\8A\DE\8D\9D\8C\9F\8A\9D\96\DE\8A\96\9B\DE\89\9F\92\92\8D\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i64 @ptrace(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
%5 = tail call dereferenceable_or_null(24) i8* @strdup(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @x(i8* %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%8 = tail call i32 @strlen(i8* %5)
%9 = tail call i32 @cleanup(i8* %5, i32 %8)
%10 = tail call i32 @exit(i32 -1)
unreachable
}