#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 rand();
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  int dice_roll = 0, result_roll = 0, result_roll1 = 0;
  char ans;
  srand(time(NULL));
  for (int i = 0; i < 3; i++) {
    dice_roll = (rand() % 6) + 1;
    printf("Dice Rollling .. ... \n");
    printf("Dice Value is: %d \n", dice_roll);
    result_roll += dice_roll;
  }
  result_roll1 = result_roll;
  printf("Current total of Dice Roll is : %d \n", result_roll1);
  printf("Now You have to guess next roll will be higher? or lower? compared "
         "to current one \n");
  printf("To represent higher press ['h'], To Represent lower press ['l'] \n");
  scanf("%c", &ans);
  result_roll = 0;
  for (int i = 0; i < 3; i++) {
    dice_roll = (rand() % 6) + 1;
    printf("Dice Rollling .. ... \n");
    printf("Dice Value is: %d \n", dice_roll);
    result_roll += dice_roll;
  }
  printf("Current total of Dice Roll is : %d \n", result_roll);
  if (result_roll > result_roll1) {
    if (ans == 'h' || ans == 'H') {
      printf("Your Guess was Right! It is Indeed Higher \n");
    } else {
      printf("Sorry, Your Guess was Wrong! It is Lower. \n");
    }
  } else if (result_roll < result_roll1) {
    if (ans == 'l' || ans == 'L') {
      printf("Your Guess was Right! It is Indeed Lower \n");
    } else {
      printf("Sorry, Your Guess was Wrong! It is Higher. \n");
    }
  } else {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
movl   $0x0,-0x18(%rbp)
cmpl   $0x3,-0x18(%rbp)
jge    11e0 <main+0x90>
mov    $0x0,%al
call   1070 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    118b <main+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe3b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
lea    -0x11(%rbp),%rsi
call   1060 <scanf@plt>
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    1286 <main+0x136>
mov    $0x0,%al
call   1070 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
lea    0xda9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xdaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1231 <main+0xe1>
mov    -0xc(%rbp),%esi
lea    0xd9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    12e3 <main+0x193>
movsbl -0x11(%rbp),%eax
cmp    $0x68,%eax
je     12bd <main+0x16d>
movsbl -0x11(%rbp),%eax
cmp    $0x48,%eax
jne    12d0 <main+0x180>
lea    0xe25(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12de <main+0x18e>
lea    0xe3e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1339 <main+0x1e9>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    132f <main+0x1df>
movsbl -0x11(%rbp),%eax
cmp    $0x6c,%eax
je     1309 <main+0x1b9>
movsbl -0x11(%rbp),%eax
cmp    $0x4c,%eax
jne    131c <main+0x1cc>
lea    0xe31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    132a <main+0x1da>
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1334 <main+0x1e4>
jmp    1334 <main+0x1e4>
jmp    1339 <main+0x1e9>
xor    %eax,%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
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%ebx
add    $0x1,%ebx
lea    0xfd2(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xe47(%rip),%r12
mov    %r12,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%r13d
add    $0x1,%r13d
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    %ebx,%r13d
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%ebx
add    $0x1,%ebx
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    %ebx,%r13d
lea    0xdc3(%rip),%r15
mov    %r15,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xdd7(%rip),%rdi
call   1030 <puts@plt>
lea    0xe1e(%rip),%rdi
call   1030 <puts@plt>
lea    0xdbc(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1070 <scanf@plt>
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%ebp
add    $0x1,%ebp
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%ebx
add    $0x1,%ebx
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    %ebp,%ebx
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%ebp
add    $0x1,%ebp
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    %ebp,%ebx
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    %r13d,%ebx
jle    136e <main+0x20e>
mov    0x7(%rsp),%al
and    $0xdf,%al
cmp    $0x48,%al
lea    0xdec(%rip),%rax
lea    0xdba(%rip),%rdi
jmp    1386 <main+0x226>
jge    138f <main+0x22f>
mov    0x7(%rsp),%al
and    $0xdf,%al
cmp    $0x4c,%al
lea    0xd7d(%rip),%rax
lea    0xd4a(%rip),%rdi
cmove  %rax,%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):
@.str = [23 x i8] c"Dice Rollling .. ... \0A\00"
@.str.1 = [20 x i8] c"Dice Value is: %d \0A\00"
@.str.2 = [37 x i8] c"Current total of Dice Roll is : %d \0A\00"
@.str.3 = [84 x i8] c"Now You have to guess next roll will be higher? or lower? compared to current one \0A\00"
@.str.4 = [66 x i8] c"To represent higher press ['h'], To Represent lower press ['l'] \0A\00"
@.str.5 = [3 x i8] c"%c\00"
@.str.6 = [44 x i8] c"Your Guess was Right! It is Indeed Higher \0A\00"
@.str.7 = [44 x i8] c"Sorry, Your Guess was Wrong! It is Lower. \0A\00"
@.str.8 = [43 x i8] c"Your Guess was Right! It is Indeed Lower \0A\00"
@.str.9 = [45 x i8] c"Sorry, Your Guess was Wrong! It is Higher. \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
%8 = call i32 @time(i32* null)
%9 = call i32 @srand(i32 %8)
store i32 0, i32* %6
br label %10
10: ; preds = %23, %0
%11 = load i32, i32* %6
%12 = icmp slt i32 %11, 3
br i1 %12, label %13, label %26
13: ; preds = %10
%14 = call i32 (...) @rand()
%15 = srem i32 %14, 6
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%18 = load i32, i32* %2
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %18)
%20 = load i32, i32* %2
%21 = load i32, i32* %3
%22 = add nsw i32 %21, %20
store i32 %22, i32* %3
br label %23
23: ; preds = %13
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
store i32 %25, i32* %6
br label %10
26: ; preds = %10
%27 = load i32, i32* %3
store i32 %27, i32* %4
%28 = load i32, i32* %4
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i32 %28)
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str.3, i64 0, i64 0))
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.4, i64 0, i64 0))
%32 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %5)
store i32 0, i32* %3
store i32 0, i32* %7
br label %33
33: ; preds = %46, %26
%34 = load i32, i32* %7
%35 = icmp slt i32 %34, 3
br i1 %35, label %36, label %49
36: ; preds = %33
%37 = call i32 (...) @rand()
%38 = srem i32 %37, 6
%39 = add nsw i32 %38, 1
store i32 %39, i32* %2
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%41 = load i32, i32* %2
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %41)
%43 = load i32, i32* %2
%44 = load i32, i32* %3
%45 = add nsw i32 %44, %43
store i32 %45, i32* %3
br label %46
46: ; preds = %36
%47 = load i32, i32* %7
%48 = add nsw i32 %47, 1
store i32 %48, i32* %7
br label %33
49: ; preds = %33
%50 = load i32, i32* %3
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i32 %50)
%52 = load i32, i32* %3
%53 = load i32, i32* %4
%54 = icmp sgt i32 %52, %53
br i1 %54, label %55, label %68
55: ; preds = %49
%56 = load i8, i8* %5
%57 = sext i8 %56 to i32
%58 = icmp eq i32 %57, 104
br i1 %58, label %63, label %59
59: ; preds = %55
%60 = load i8, i8* %5
%61 = sext i8 %60 to i32
%62 = icmp eq i32 %61, 72
br i1 %62, label %63, label %65
63: ; preds = %59, %55
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0))
br label %67
65: ; preds = %59
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.7, i64 0, i64 0))
br label %67
67: ; preds = %65, %63
br label %87
68: ; preds = %49
%69 = load i32, i32* %3
%70 = load i32, i32* %4
%71 = icmp slt i32 %69, %70
br i1 %71, label %72, label %85
72: ; preds = %68
%73 = load i8, i8* %5
%74 = sext i8 %73 to i32
%75 = icmp eq i32 %74, 108
br i1 %75, label %80, label %76
76: ; preds = %72
%77 = load i8, i8* %5
%78 = sext i8 %77 to i32
%79 = icmp eq i32 %78, 76
br i1 %79, label %80, label %82
80: ; preds = %76, %72
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.8, i64 0, i64 0))
br label %84
82: ; preds = %76
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.9, i64 0, i64 0))
br label %84
84: ; preds = %82, %80
br label %86
85: ; preds = %68
br label %86
86: ; preds = %85, %84
br label %87
87: ; preds = %86, %67
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c"Dice Value is: %d \0A\00"
@.str.2 = [37 x i8] c"Current total of Dice Roll is : %d \0A\00"
@.str.5 = [3 x i8] c"%c\00"
@str = [83 x i8] c"Now You have to guess next roll will be higher? or lower? compared to current one \00"
@str.10 = [65 x i8] c"To represent higher press ['h'], To Represent lower press ['l'] \00"
@str.11 = [44 x i8] c"Sorry, Your Guess was Wrong! It is Higher. \00"
@str.12 = [42 x i8] c"Your Guess was Right! It is Indeed Lower \00"
@str.13 = [43 x i8] c"Sorry, Your Guess was Wrong! It is Lower. \00"
@str.14 = [43 x i8] c"Your Guess was Right! It is Indeed Higher \00"
@str.16 = [22 x i8] c"Dice Rollling .. ... \00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, 6
%6 = add nsw i32 %5, 1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.16, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%9 = tail call i32 (...) @rand()
%10 = srem i32 %9, 6
%11 = add nsw i32 %10, 1
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.16, i64 0, i64 0))
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%14 = add nsw i32 %11, %6
%15 = tail call i32 (...) @rand()
%16 = srem i32 %15, 6
%17 = add nsw i32 %16, 1
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.16, i64 0, i64 0))
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %17)
%20 = add nsw i32 %17, %14
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i32 %20)
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([83 x i8], [83 x i8]* @str, i64 0, i64 0))
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str.10, i64 0, i64 0))
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %1)
%25 = call i32 (...) @rand()
%26 = srem i32 %25, 6
%27 = add nsw i32 %26, 1
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.16, i64 0, i64 0))
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %27)
%30 = call i32 (...) @rand()
%31 = srem i32 %30, 6
%32 = add nsw i32 %31, 1
%33 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.16, i64 0, i64 0))
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %32)
%35 = add nsw i32 %32, %27
%36 = call i32 (...) @rand()
%37 = srem i32 %36, 6
%38 = add nsw i32 %37, 1
%39 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.16, i64 0, i64 0))
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %38)
%41 = add nsw i32 %38, %35
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i32 %41)
%43 = icmp sgt i32 %41, %20
br i1 %43, label %44, label %49
44: ; preds = %0
%45 = load i8, i8* %1
%46 = and i8 %45, -33
%47 = icmp eq i8 %46, 72
%48 = select i1 %47, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @str.14, i64 0, i64 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @str.13, i64 0, i64 0)
br label %56
49: ; preds = %0
%50 = icmp slt i32 %41, %20
br i1 %50, label %51, label %59
51: ; preds = %49
%52 = load i8, i8* %1
%53 = and i8 %52, -33
%54 = icmp eq i8 %53, 76
%55 = select i1 %54, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @str.12, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @str.11, i64 0, i64 0)
br label %56
56: ; preds = %51, %44
%57 = phi i8* [ %48, %44 ], [ %55, %51 ]
%58 = call i32 @puts(i8* dereferenceable(1) %57)
br label %59
59: ; preds = %56, %49
ret i32 0
}