#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*/ pause_clear(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ system(char *);
void display_end_message(int points, int difficulty) {
  system("cls");
  printf(
      "You have answered all 10 question!\nYou got %d points while playing on ",
      points);
  if (difficulty == 1) {
    printf("easy!\n");
  } else if (difficulty == 2) {
    printf("fair!\n");
  } else if (difficulty == 3) {
    printf("intermediate!\n");
  } else if (difficulty == 4) {
    printf("hard!\n");
  } else {
    printf("impossible!\n");
  }
  printf("Your score has been entered in the high scores list, see how you "
         "did!\n\n");
  pause_clear(1, 1);
}


x86 assembly (clang, -O0):
<display_end_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xebb(%rip),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%esi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x1,-0x8(%rbp)
jne    1178 <display_end_message+0x48>
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11ec <display_end_message+0xbc>
cmpl   $0x2,-0x8(%rbp)
jne    1195 <display_end_message+0x65>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11e7 <display_end_message+0xb7>
cmpl   $0x3,-0x8(%rbp)
jne    11b2 <display_end_message+0x82>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11e2 <display_end_message+0xb2>
cmpl   $0x4,-0x8(%rbp)
jne    11cf <display_end_message+0x9f>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11dd <display_end_message+0xad>
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11e2 <display_end_message+0xb2>
jmp    11e7 <display_end_message+0xb7>
jmp    11ec <display_end_message+0xbc>
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%esi
mov    %esi,%edi
call   1050 <pause_clear@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_end_message>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xeb2(%rip),%rdi
call   1040 <system@plt>
lea    0xeaa(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0xffffffff,%ebx
cmp    $0x3,%ebx
ja     117e <display_end_message+0x3e>
movslq %ebx,%rax
lea    0xf4b(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    1185 <display_end_message+0x45>
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
mov    $0x1,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <pause_clear@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"cls\00"
@.str.1 = [71 x i8] c"You have answered all 10 question!\0AYou got %d points while playing on \00"
@.str.2 = [7 x i8] c"easy!\0A\00"
@.str.3 = [7 x i8] c"fair!\0A\00"
@.str.4 = [15 x i8] c"intermediate!\0A\00"
@.str.5 = [7 x i8] c"hard!\0A\00"
@.str.6 = [13 x i8] c"impossible!\0A\00"
@.str.7 = [72 x i8] c"Your score has been entered in the high scores list, see how you did!\0A\0A\00"
define void @display_end_message(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %32
12: ; preds = %2
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 2
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %31
17: ; preds = %12
%18 = load i32, i32* %4
%19 = icmp eq i32 %18, 3
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
br label %30
22: ; preds = %17
%23 = load i32, i32* %4
%24 = icmp eq i32 %23, 4
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
br label %29
27: ; preds = %22
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
br label %29
29: ; preds = %27, %25
br label %30
30: ; preds = %29, %20
br label %31
31: ; preds = %30, %15
br label %32
32: ; preds = %31, %10
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.7, i64 0, i64 0))
%34 = call i32 @pause_clear(i32 1, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"cls\00"
@.str.1 = [71 x i8] c"You have answered all 10 question!\0AYou got %d points while playing on \00"
@str = [12 x i8] c"impossible!\00"
@str.8 = [71 x i8] c"Your score has been entered in the high scores list, see how you did!\0A\00"
@str.9 = [6 x i8] c"hard!\00"
@str.10 = [14 x i8] c"intermediate!\00"
@str.11 = [6 x i8] c"fair!\00"
@str.12 = [6 x i8] c"easy!\00"
@reltable.display_end_message = [4 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @str.12 to i64), i64 ptrtoint ([4 x i32]* @reltable.display_end_message to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @str.11 to i64), i64 ptrtoint ([4 x i32]* @reltable.display_end_message to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @str.10 to i64), i64 ptrtoint ([4 x i32]* @reltable.display_end_message to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @str.9 to i64), i64 ptrtoint ([4 x i32]* @reltable.display_end_message to i64)) to i32)]
define void @display_end_message(i32 %0, i32 %1) {
%3 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%5 = add i32 %1, -1
%6 = icmp ult i32 %5, 4
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = sext i32 %5 to i64
%9 = shl i64 %8, 2
%10 = call i8* @llvm.load.relative.i64(i8* bitcast ([4 x i32]* @reltable.display_end_message to i8*), i64 %9)
br label %11
11: ; preds = %2, %7
%12 = phi i8* [ %10, %7 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0), %2 ]
%13 = tail call i32 @puts(i8* dereferenceable(1) %12)
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str.8, i64 0, i64 0))
%15 = tail call i32 @pause_clear(i32 1, i32 1)
ret void
}