#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*/ eingabe2(unsigned char **);
unsigned char einlesen_char();
scalar_t__ fillchar2(unsigned char **, int /*<<< orphan*/, char, char);
int /*<<< orphan*/ free(unsigned char *);
int /*<<< orphan*/ getlength(unsigned char *);
scalar_t__ is_in2(unsigned char *, unsigned char *, unsigned char);
scalar_t__ is_in_check(unsigned char *, char);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int tries = 5;
  unsigned char x;
  unsigned char *eingabe_henker = NULL;
  unsigned char *eingabe_reveal = NULL;
  eingabe2(&eingabe_henker);
  if (fillchar2(&eingabe_reveal, getlength(eingabe_henker), '_', ' ') == 0)
    return 1;
  printf("%s\n", eingabe_reveal);
  while (tries > 0) {
    x = einlesen_char();
    if (is_in2(eingabe_henker, eingabe_reveal, x) == 0) {
      tries--;
    }
    printf("Noch %i Versuche.\n", tries);
    printf("%s\n", eingabe_reveal);
    if (is_in_check(eingabe_reveal, '_') == 0)
      break;
  }
  printf("Das Wort war: %s\n", eingabe_henker);
  if (tries >= 1)
    printf("Die Spieler haben gewonnen\n");
  else
    printf("Der Sensenmann hat euch alle gep0wnt\n");
  free(eingabe_reveal);
  eingabe_reveal = NULL;
  free(eingabe_henker);
  eingabe_henker = NULL;
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
lea    -0x18(%rbp),%rdi
call   1040 <eingabe2@plt>
mov    -0x18(%rbp),%rdi
call   1060 <getlength@plt>
mov    %eax,%esi
lea    -0x20(%rbp),%rdi
mov    $0x5f,%edx
mov    $0x20,%ecx
call   1080 <fillchar2@plt>
cmp    $0x0,%rax
jne    11e3 <main+0x63>
movl   $0x1,-0x4(%rbp)
jmp    12d8 <main+0x158>
mov    -0x20(%rbp),%rsi
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
cmpl   $0x0,-0x8(%rbp)
jle    1272 <main+0xf2>
mov    $0x0,%al
call   1090 <einlesen_char@plt>
mov    %al,-0x9(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
movzbl -0x9(%rbp),%edx
call   10a0 <is_in2@plt>
cmp    $0x0,%rax
jne    122d <main+0xad>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xdc9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xdd8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    $0x5f,%esi
call   1070 <is_in_check@plt>
cmp    $0x0,%rax
jne    126d <main+0xed>
jmp    1272 <main+0xf2>
jmp    11f5 <main+0x75>
mov    -0x18(%rbp),%rsi
lea    0xd96(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
cmpl   $0x1,-0x8(%rbp)
jl     12a1 <main+0x121>
lea    0xd90(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    12af <main+0x12f>
lea    0xd99(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x8(%rsp)
movq   $0x0,(%rsp)
lea    0x8(%rsp),%rdi
call   1050 <eingabe2@plt>
mov    0x8(%rsp),%rdi
call   1070 <getlength@plt>
mov    %rsp,%rdi
mov    %eax,%esi
mov    $0x5f,%edx
mov    $0x20,%ecx
call   1090 <fillchar2@plt>
test   %rax,%rax
je     1289 <main+0xf9>
mov    (%rsp),%rdi
call   1040 <puts@plt>
mov    $0x5,%ebp
lea    0xe11(%rip),%r14
nop
xor    %eax,%eax
call   10a0 <einlesen_char@plt>
mov    0x8(%rsp),%rdi
mov    (%rsp),%rsi
movzbl %al,%edx
call   10b0 <is_in2@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
mov    %ebp,%esi
sub    %ebx,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    (%rsp),%rdi
call   1040 <puts@plt>
mov    (%rsp),%rdi
mov    $0x5f,%esi
call   1080 <is_in_check@plt>
sub    %ebx,%ebp
je     123e <main+0xae>
test   %rax,%rax
jne    11f0 <main+0x60>
mov    0x8(%rsp),%rsi
lea    0xdc9(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <printf@plt>
test   %ebp,%ebp
lea    0xdee(%rip),%rax
lea    0xdc2(%rip),%rdi
cmovne %rax,%rdi
call   1040 <puts@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
movq   $0x0,(%rsp)
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
jmp    128e <main+0xfe>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [19 x i8] c"Noch %i Versuche.\0A\00"
@.str.2 = [18 x i8] c"Das Wort war: %s\0A\00"
@.str.3 = [28 x i8] c"Die Spieler haben gewonnen\0A\00"
@.str.4 = [38 x i8] c"Der Sensenmann hat euch alle gep0wnt\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8*
%5 = alloca i8*
store i32 0, i32* %1
store i32 5, i32* %2
store i8* null, i8** %4
store i8* null, i8** %5
%6 = call i32 @eingabe2(i8** %4)
%7 = load i8*, i8** %4
%8 = call i32 @getlength(i8* %7)
%9 = call i64 @fillchar2(i8** %5, i32 %8, i8 signext 95, i8 signext 32)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %0
store i32 1, i32* %1
br label %52
12: ; preds = %0
%13 = load i8*, i8** %5
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %37, %12
%16 = load i32, i32* %2
%17 = icmp sgt i32 %16, 0
br i1 %17, label %18, label %38
18: ; preds = %15
%19 = call zeroext i8 (...) @einlesen_char()
store i8 %19, i8* %3
%20 = load i8*, i8** %4
%21 = load i8*, i8** %5
%22 = load i8, i8* %3
%23 = call i64 @is_in2(i8* %20, i8* %21, i8 zeroext %22)
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %18
%26 = load i32, i32* %2
%27 = add nsw i32 %26, -1
store i32 %27, i32* %2
br label %28
28: ; preds = %25, %18
%29 = load i32, i32* %2
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %29)
%31 = load i8*, i8** %5
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %31)
%33 = load i8*, i8** %5
%34 = call i64 @is_in_check(i8* %33, i8 signext 95)
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %37
36: ; preds = %28
br label %38
37: ; preds = %28
br label %15
38: ; preds = %36, %15
%39 = load i8*, i8** %4
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %39)
%41 = load i32, i32* %2
%42 = icmp sge i32 %41, 1
br i1 %42, label %43, label %45
43: ; preds = %38
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
br label %47
45: ; preds = %38
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
br label %47
47: ; preds = %45, %43
%48 = load i8*, i8** %5
%49 = call i32 @free(i8* %48)
store i8* null, i8** %5
%50 = load i8*, i8** %4
%51 = call i32 @free(i8* %50)
store i8* null, i8** %4
store i32 0, i32* %1
br label %52
52: ; preds = %47, %11
%53 = load i32, i32* %1
ret i32 %53
}

LLVM IR (-O2):
@.str.1 = [19 x i8] c"Noch %i Versuche.\0A\00"
@.str.2 = [18 x i8] c"Das Wort war: %s\0A\00"
@str = [37 x i8] c"Der Sensenmann hat euch alle gep0wnt\00"
@str.5 = [27 x i8] c"Die Spieler haben gewonnen\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca i8*
%3 = bitcast i8** %1 to i8*
store i8* null, i8** %1
%4 = bitcast i8** %2 to i8*
store i8* null, i8** %2
%5 = call i32 @eingabe2(i8** %1)
%6 = load i8*, i8** %1
%7 = call i32 @getlength(i8* %6)
%8 = call i64 @fillchar2(i8** %2, i32 %7, i8 signext 95, i8 signext 32)
%9 = icmp eq i64 %8, 0
br i1 %9, label %39, label %10
10: ; preds = %0
%11 = load i8*, i8** %2
%12 = call i32 @puts(i8* dereferenceable(1) %11)
br label %13
13: ; preds = %10, %13
%14 = phi i32 [ 5, %10 ], [ %21, %13 ]
%15 = call zeroext i8 (...) @einlesen_char()
%16 = load i8*, i8** %1
%17 = load i8*, i8** %2
%18 = call i64 @is_in2(i8* %16, i8* %17, i8 zeroext %15)
%19 = icmp eq i64 %18, 0
%20 = sext i1 %19 to i32
%21 = add nsw i32 %14, %20
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %21)
%23 = load i8*, i8** %2
%24 = call i32 @puts(i8* dereferenceable(1) %23)
%25 = load i8*, i8** %2
%26 = call i64 @is_in_check(i8* %25, i8 signext 95)
%27 = icmp ne i64 %26, 0
%28 = icmp ne i32 %21, 0
%29 = and i1 %28, %27
br i1 %29, label %13, label %30
30: ; preds = %13
%31 = load i8*, i8** %1
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %31)
%33 = select i1 %28, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @str.5, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0)
%34 = call i32 @puts(i8* dereferenceable(1) %33)
%35 = load i8*, i8** %2
%36 = call i32 @free(i8* %35)
store i8* null, i8** %2
%37 = load i8*, i8** %1
%38 = call i32 @free(i8* %37)
br label %39
39: ; preds = %0, %30
%40 = phi i32 [ 0, %30 ], [ 1, %0 ]
ret i32 %40
}