#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 *, int *);
int /*<<< orphan*/ system(char *);
int main() {
  int firstNumber = 1 + rand() % 9, secondNumber = 1 + rand() % 9, HumanResult;
  printf("Skilky byde %d*%d? -> ", firstNumber, secondNumber);
  scanf("%d", &HumanResult);
  if (firstNumber * secondNumber == HumanResult)
    printf("Pravulno!");
  else
    printf("Vu pomululys! %d*%d=%d", firstNumber, secondNumber,
           firstNumber * secondNumber);
  system("PAUSE");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x9,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x9,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea1(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    11c0 <main+0x80>
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11db <main+0x9b>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe56(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x38e38e39,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,8),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%ebx
add    $0x1,%ebx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x38e38e39,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,8),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%ebp
add    $0x1,%ebp
lea    0xe66(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe89(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    %ebp,%ecx
imul   %ebx,%ecx
cmp    0x4(%rsp),%ecx
jne    11d1 <main+0x91>
lea    0xe4f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11e3 <main+0xa3>
lea    0xe49(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe4e(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Skilky byde %d*%d? -> \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [10 x i8] c"Pravulno!\00"
@.str.3 = [23 x i8] c"Vu pomululys! %d*%d=%d\00"
@.str.4 = [6 x i8] c"PAUSE\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @rand()
%6 = srem i32 %5, 9
%7 = add nsw i32 1, %6
store i32 %7, i32* %2
%8 = call i32 (...) @rand()
%9 = srem i32 %8, 9
%10 = add nsw i32 1, %9
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = mul nsw i32 %15, %16
%18 = load i32, i32* %4
%19 = icmp eq i32 %17, %18
br i1 %19, label %20, label %22
20: ; preds = %0
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %29
22: ; preds = %0
%23 = load i32, i32* %2
%24 = load i32, i32* %3
%25 = load i32, i32* %2
%26 = load i32, i32* %3
%27 = mul nsw i32 %25, %26
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %23, i32 %24, i32 %27)
br label %29
29: ; preds = %22, %20
%30 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Skilky byde %d*%d? -> \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [10 x i8] c"Pravulno!\00"
@.str.3 = [23 x i8] c"Vu pomululys! %d*%d=%d\00"
@.str.4 = [6 x i8] c"PAUSE\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, 9
%4 = add nsw i32 %3, 1
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 9
%7 = add nsw i32 %6, 1
%8 = bitcast i32* %1 to i8*
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %7)
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%11 = mul nsw i32 %7, %4
%12 = load i32, i32* %1
%13 = icmp eq i32 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %0
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %18
16: ; preds = %0
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %4, i32 %7, i32 %11)
br label %18
18: ; preds = %16, %14
%19 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}