#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*/ exit(int);
scalar_t__ memcmp(char *, char *, int);
int /*<<< orphan*/ nixtrace(char *);
int /*<<< orphan*/ printf(char *);
void integritaet_speziell(void *palt) {
  char *p;
  long size_lfd;
  p = palt;
  p -= 24;
  nixtrace("Pruefung der Integritaet\n");
  if (memcmp(p + 12, "<0123456789>", 12) != 0) {
    printf("integritaet_speziell - schrecklicher Speicherfehler\n");
    printf("Bereich vor Datenblock zerstoert\n");
    exit(20);
  }
  size_lfd = *((long *)(p + 8));
  if (memcmp(p + 24 + size_lfd, "<0123456789>", 12) != 0) {
    printf("integritaet_speziell - schrecklicher Speicherfehler\n");
    printf("Bereich nach Datenblock zerstoert\n");
    exit(20);
  }
  return;
}


x86 assembly (clang, -O0):
<integritaet_speziell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffe8,%rax
mov    %rax,-0x10(%rbp)
lea    0xe99(%rip),%rdi
call   1060 <nixtrace@plt>
mov    -0x10(%rbp),%rdi
add    $0xc,%rdi
lea    0xe9f(%rip),%rsi
mov    $0xc,%edx
call   1040 <memcmp@plt>
cmp    $0x0,%rax
je     11b1 <integritaet_speziell+0x71>
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    $0x14,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x18,%rdi
add    -0x18(%rbp),%rdi
lea    0xe4a(%rip),%rsi
mov    $0xc,%edx
call   1040 <memcmp@plt>
cmp    $0x0,%rax
je     1206 <integritaet_speziell+0xc6>
lea    0xe3c(%rip),%rdi
call   1030 <printf@plt>
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
mov    $0x14,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<integritaet_speziell>:
push   %rbx
mov    %rdi,%rbx
lea    0xeb5(%rip),%rdi
call   1060 <nixtrace@plt>
lea    -0xc(%rbx),%rdi
lea    0xebf(%rip),%rsi
mov    $0xc,%edx
call   1040 <memcmp@plt>
test   %rax,%rax
jne    1189 <integritaet_speziell+0x49>
add    -0x10(%rbx),%rbx
lea    0xea5(%rip),%rsi
mov    %rbx,%rdi
mov    $0xc,%edx
call   1040 <memcmp@plt>
test   %rax,%rax
jne    119e <integritaet_speziell+0x5e>
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
call   1030 <puts@plt>
lea    0xee1(%rip),%rdi
jmp    11b1 <integritaet_speziell+0x71>
lea    0xea4(%rip),%rdi
call   1030 <puts@plt>
lea    0xe76(%rip),%rdi
call   1030 <puts@plt>
mov    $0x14,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Pruefung der Integritaet\0A\00"
@.str.1 = [13 x i8] c"<0123456789>\00"
@.str.2 = [53 x i8] c"integritaet_speziell - schrecklicher Speicherfehler\0A\00"
@.str.3 = [34 x i8] c"Bereich vor Datenblock zerstoert\0A\00"
@.str.4 = [35 x i8] c"Bereich nach Datenblock zerstoert\0A\00"
define void @integritaet_speziell(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 -24
store i8* %7, i8** %3
%8 = call i32 @nixtrace(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 12
%11 = call i64 @memcmp(i8* %10, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 12)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %1
%14 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 @exit(i32 20)
unreachable
17: ; preds = %1
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 8
%20 = bitcast i8* %19 to i64*
%21 = load i64, i64* %20
store i64 %21, i64* %4
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 24
%24 = load i64, i64* %4
%25 = getelementptr inbounds i8, i8* %23, i64 %24
%26 = call i64 @memcmp(i8* %25, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 12)
%27 = icmp ne i64 %26, 0
br i1 %27, label %28, label %32
28: ; preds = %17
%29 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
%30 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0))
%31 = call i32 @exit(i32 20)
unreachable
32: ; preds = %17
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Pruefung der Integritaet\0A\00"
@.str.1 = [13 x i8] c"<0123456789>\00"
@str.5 = [34 x i8] c"Bereich nach Datenblock zerstoert\00"
@str.6 = [52 x i8] c"integritaet_speziell - schrecklicher Speicherfehler\00"
@str.7 = [33 x i8] c"Bereich vor Datenblock zerstoert\00"
define void @integritaet_speziell(i8* %0) {
%2 = tail call i32 @nixtrace(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds i8, i8* %0, i64 -12
%4 = tail call i64 @memcmp(i8* %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 12)
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.6, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.7, i64 0, i64 0))
%9 = tail call i32 @exit(i32 20)
unreachable
10: ; preds = %1
%11 = getelementptr inbounds i8, i8* %0, i64 -16
%12 = bitcast i8* %11 to i64*
%13 = load i64, i64* %12
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = tail call i64 @memcmp(i8* %14, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 12)
%16 = icmp eq i64 %15, 0
br i1 %16, label %21, label %17
17: ; preds = %10
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.6, i64 0, i64 0))
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.5, i64 0, i64 0))
%20 = tail call i32 @exit(i32 20)
unreachable
21: ; preds = %10
ret void
}