#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*/ printf(char *, ...);
int const rand();
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ setbuf(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  setbuf(stdout, NULL);
  const int lb = 1, ub = 100;
  int geheimeZahl;
  int Zahl = 0;
  srand(time(NULL));
  geheimeZahl = (rand() % ((ub + 1) - lb)) + lb;
  while (Zahl != geheimeZahl) {
    printf("\n\n\t\tGib mir eine Zahl zwischen 1 und 100 um die Geheimzahl zu "
           "erraten:\n\n\t\t>>> ");
    scanf("%d", &Zahl);
    if (Zahl < 1 || Zahl > 100) {
      printf("\n\t\t>>> Diese Zahl \"%i\" liegt ausserhalb der Grenze 1 - "
             "100!\n\n",
             Zahl);
    } else if (Zahl == geheimeZahl) {
      printf("\n\t\tHurra, hast gewonnen!\n");
      printf("\n\t\tBist doof, hab keine Lust mehr zu spielen, bring mir ein "
             "Bier...\n\n\n");
      return 0;
    } else if (Zahl > geheimeZahl) {
      printf("\n\t\tWeniger bieten Du musst...");
    } else {
      printf("\n\t\tMehr bieten Du musst...");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <setbuf@plt>
movl   $0x1,-0x8(%rbp)
movl   $0x64,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    $0x0,%al
call   1080 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     127f <main+0x11f>
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe73(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1070 <scanf@plt>
cmpl   $0x1,-0x14(%rbp)
jl     11f9 <main+0x99>
cmpl   $0x64,-0x14(%rbp)
jle    120f <main+0xaf>
mov    -0x14(%rbp),%esi
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    127a <main+0x11a>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1243 <main+0xe3>
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1286 <main+0x126>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1262 <main+0x102>
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1270 <main+0x110>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1275 <main+0x115>
jmp    127a <main+0x11a>
jmp    11bb <main+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1040 <setbuf@plt>
movl   $0x0,0x4(%rsp)
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
xor    %eax,%eax
call   1090 <rand@plt>
movslq %eax,%r13
imul   $0x51eb851f,%r13,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%r13d
inc    %r13d
je     127b <main+0x10b>
lea    0xe2b(%rip),%r14
lea    0xe73(%rip),%r15
lea    0x4(%rsp),%rbx
lea    0xe6a(%rip),%r12
lea    0xebf(%rip),%rbp
jmp    1211 <main+0xa1>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    %r13d,0x4(%rsp)
je     127b <main+0x10b>
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1080 <scanf@plt>
mov    0x4(%rsp),%esi
lea    -0x65(%rsi),%eax
cmp    $0xffffff9b,%eax
jbe    1200 <main+0x90>
cmp    %r13d,%esi
je     1263 <main+0xf3>
jle    1250 <main+0xe0>
lea    0xe50(%rip),%rdi
jmp    1253 <main+0xe3>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    %r13d,0x4(%rsp)
jne    1211 <main+0xa1>
jmp    127b <main+0x10b>
lea    0xe5f(%rip),%rdi
call   1030 <puts@plt>
lea    0xe6c(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [79 x i8] c"\0A\0A\09\09Gib mir eine Zahl zwischen 1 und 100 um die Geheimzahl zu erraten:\0A\0A\09\09>>> \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [62 x i8] c"\0A\09\09>>> Diese Zahl \22%i\22 liegt ausserhalb der Grenze 1 - 100!\0A\0A\00"
@.str.3 = [26 x i8] c"\0A\09\09Hurra, hast gewonnen!\0A\00"
@.str.4 = [71 x i8] c"\0A\09\09Bist doof, hab keine Lust mehr zu spielen, bring mir ein Bier...\0A\0A\0A\00"
@.str.5 = [30 x i8] c"\0A\09\09Weniger bieten Du musst...\00"
@.str.6 = [27 x i8] c"\0A\09\09Mehr bieten Du musst...\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = load i32, i32* @stdout
%7 = call i32 @setbuf(i32 %6, i32* null)
store i32 1, i32* %2
store i32 100, i32* %3
store i32 0, i32* %5
%8 = call i32 @time(i32* null)
%9 = call i32 @srand(i32 %8)
%10 = call i32 (...) @rand()
%11 = srem i32 %10, 100
%12 = add nsw i32 %11, 1
store i32 %12, i32* %4
br label %13
13: ; preds = %45, %0
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = icmp ne i32 %14, %15
br i1 %16, label %17, label %46
17: ; preds = %13
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%20 = load i32, i32* %5
%21 = icmp slt i32 %20, 1
br i1 %21, label %25, label %22
22: ; preds = %17
%23 = load i32, i32* %5
%24 = icmp sgt i32 %23, 100
br i1 %24, label %25, label %28
25: ; preds = %22, %17
%26 = load i32, i32* %5
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0), i32 %26)
br label %45
28: ; preds = %22
%29 = load i32, i32* %5
%30 = load i32, i32* %4
%31 = icmp eq i32 %29, %30
br i1 %31, label %32, label %35
32: ; preds = %28
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %1
br label %47
35: ; preds = %28
%36 = load i32, i32* %5
%37 = load i32, i32* %4
%38 = icmp sgt i32 %36, %37
br i1 %38, label %39, label %41
39: ; preds = %35
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0))
br label %43
41: ; preds = %35
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0))
br label %43
43: ; preds = %41, %39
br label %44
44: ; preds = %43
br label %45
45: ; preds = %44, %25
br label %13
46: ; preds = %13
store i32 0, i32* %1
br label %47
47: ; preds = %46, %32
%48 = load i32, i32* %1
ret i32 %48
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [79 x i8] c"\0A\0A\09\09Gib mir eine Zahl zwischen 1 und 100 um die Geheimzahl zu erraten:\0A\0A\09\09>>> \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [62 x i8] c"\0A\09\09>>> Diese Zahl \22%i\22 liegt ausserhalb der Grenze 1 - 100!\0A\0A\00"
@.str.5 = [30 x i8] c"\0A\09\09Weniger bieten Du musst...\00"
@.str.6 = [27 x i8] c"\0A\09\09Mehr bieten Du musst...\00"
@str = [25 x i8] c"\0A\09\09Hurra, hast gewonnen!\00"
@str.7 = [70 x i8] c"\0A\09\09Bist doof, hab keine Lust mehr zu spielen, bring mir ein Bier...\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = load i32, i32* @stdout
%3 = tail call i32 @setbuf(i32 %2, i32* null)
%4 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%5 = tail call i32 @time(i32* null)
%6 = tail call i32 @srand(i32 %5)
%7 = tail call i32 (...) @rand()
%8 = srem i32 %7, 100
%9 = add nsw i32 %8, 1
%10 = icmp eq i32 %9, 0
br i1 %10, label %33, label %11
11: ; preds = %0, %30
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%14 = load i32, i32* %1
%15 = add i32 %14, -101
%16 = icmp ult i32 %15, -100
br i1 %16, label %17, label %19
17: ; preds = %11
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0), i32 %14)
br label %30
19: ; preds = %11
%20 = icmp eq i32 %14, %9
br i1 %20, label %21, label %24
21: ; preds = %19
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @str.7, i64 0, i64 0))
br label %33
24: ; preds = %19
%25 = icmp sgt i32 %14, %9
br i1 %25, label %26, label %28
26: ; preds = %24
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0))
br label %30
28: ; preds = %24
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0))
br label %30
30: ; preds = %28, %26, %17
%31 = load i32, i32* %1
%32 = icmp eq i32 %31, %9
br i1 %32, label %33, label %11
33: ; preds = %30, %0, %21
ret i32 0
}