#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 Random(int);
int /*<<< orphan*/ printf(char *, ...);
int rand();
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int q, a, k = 0, Sb = 1000000, St = 0, B = 0, SUM = 0;
  printf("Сумма в банке = %d\n", Sb);
  printf("\n");
  while (k != 2) {
    if (SUM < 20) {
      SUM = SUM + Random(a);
      q++;
    }
    if (SUM > 20 || SUM == 20) {
      printf("Ваша ставка = ");
      scanf("%d", &St);
    }
    if (SUM > 20) {
      Sb = Sb + St;
      B = B - St;
      printf("Сумма очков на кубиках = %d\n", SUM);
      printf("Кол-во бросков = %d\n", q);
      printf("Вы проиграли :(\n");
      printf("Ваша текущая сумма денег = %d\n", B);
      printf("Сейчас в банке = %d\n", Sb);
      printf("Желаете продолжить игру?\n");
      printf("1-Да  2-Нет\n");
      scanf("%d", &k);
      St = 0;
      if (k == 2)
        break;
      SUM = 0;
    }
    if (SUM == 20) {
      B = B + St * 2;
      Sb = Sb - St * 2;
      printf("Сумма очков на кубиках = %d\n", SUM);
      printf("Кол-во бросков = %d\n", q);
      printf("Поздравляем вы победили\n");
      printf("Ваша текущая сумма денег = %d\n", B);
      printf("Сейчас в банке = %d\n", Sb);
      printf("Желаете продолжить игру?\n");
      printf("1-Да  2-Нет\n");
      scanf("%d", &k);
      if (k == 2)
        break;
      SUM = 0;
      St = 0;
      if (k == 2)
        break;
    }
    if (k == 2)
      break;
  }
  return 0;
}
int Random(int a) {
  int z = 0;
  z = z + rand() % 6 + 1;
  z = z + rand() % 6 + 1;
  int Random = z;
  return Random;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0xf4240,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf1c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x2,-0x10(%rbp)
je     1398 <main+0x258>
cmpl   $0x14,-0x20(%rbp)
jge    11c6 <main+0x86>
mov    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <Random@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x14,-0x20(%rbp)
jg     11da <main+0x9a>
cmpl   $0x14,-0x20(%rbp)
jne    11f8 <main+0xb8>
lea    0xe3e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe49(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x14,-0x20(%rbp)
jle    12af <main+0x16f>
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x1c(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%esi
lea    0xe1d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdaf(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
movl   $0x0,-0x18(%rbp)
cmpl   $0x2,-0x10(%rbp)
jne    12a8 <main+0x168>
jmp    1398 <main+0x258>
movl   $0x0,-0x20(%rbp)
cmpl   $0x14,-0x20(%rbp)
jne    1384 <main+0x244>
mov    -0x1c(%rbp),%eax
mov    -0x18(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x18(%rbp),%ecx
shl    $0x1,%ecx
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%esi
lea    0xd5c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xd7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xd99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xdbc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdcf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdf0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xcee(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x2,-0x10(%rbp)
jne    1362 <main+0x222>
jmp    1398 <main+0x258>
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x2,-0x10(%rbp)
jne    137f <main+0x23f>
jmp    1398 <main+0x258>
jmp    1384 <main+0x244>
cmpl   $0x2,-0x10(%rbp)
jne    1393 <main+0x253>
jmp    1398 <main+0x258>
jmp    1191 <main+0x51>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0xe8f(%rip),%rdi
mov    $0xf4240,%ebx
mov    $0xf4240,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xea5(%rip),%r15
xor    %r13d,%r13d
xor    %ebp,%ebp
jmp    1241 <main+0xf1>
nopl   (%rax)
mov    (%rsp),%eax
add    %eax,%ebx
sub    %eax,%r13d
lea    0xe8c(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeac(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf3e(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb0(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xed3(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf2c(%rip),%rdi
call   1040 <puts@plt>
lea    0xf4e(%rip),%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
movl   $0x0,(%rsp)
mov    0x4(%rsp),%eax
mov    $0x0,%ebp
cmp    $0x2,%eax
je     1369 <main+0x219>
add    $0x1,%r14d
cmp    $0x2,%eax
je     1369 <main+0x219>
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%r12
imul   $0x2aaaaaab,%r12,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%r12d
add    %ebp,%r12d
xor    %eax,%eax
call   1070 <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
sub    %ecx,%eax
lea    (%r12,%rax,1),%ebp
add    $0x2,%ebp
cmp    $0x14,%ebp
jl     12b3 <main+0x163>
lea    0xd7e(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %rsp,%rsi
call   1060 <scanf@plt>
cmp    $0x15,%ebp
jge    11a0 <main+0x50>
cmp    $0x14,%ebp
jne    1360 <main+0x210>
mov    (%rsp),%eax
lea    0x0(%r13,%rax,2),%r13d
add    %eax,%eax
sub    %eax,%ebx
lea    0xd63(%rip),%rdi
mov    $0x14,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd80(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xde5(%rip),%rdi
call   1040 <puts@plt>
lea    0xd84(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xda7(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe00(%rip),%rdi
call   1040 <puts@plt>
lea    0xe22(%rip),%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x2,%eax
je     1369 <main+0x219>
movl   $0x0,(%rsp)
xor    %ebp,%ebp
jmp    1234 <main+0xe4>
xchg   %ax,%ax
mov    0x4(%rsp),%eax
jmp    1234 <main+0xe4>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
nopw   0x0(%rax,%rax,1)

LLVM IR (-O0):
@.str = [31 x i8] c"\D0\A1\D1\83\D0\BC\D0\BC\D0\B0 \D0\B2 \D0\B1\D0\B0\D0\BD\D0\BA\D0\B5 = %d\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [25 x i8] c"\D0\92\D0\B0\D1\88\D0\B0 \D1\81\D1\82\D0\B0\D0\B2\D0\BA\D0\B0 = \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [48 x i8] c"\D0\A1\D1\83\D0\BC\D0\BC\D0\B0 \D0\BE\D1\87\D0\BA\D0\BE\D0\B2 \D0\BD\D0\B0 \D0\BA\D1\83\D0\B1\D0\B8\D0\BA\D0\B0\D1\85 = %d\0A\00"
@.str.5 = [33 x i8] c"\D0\9A\D0\BE\D0\BB-\D0\B2\D0\BE \D0\B1\D1\80\D0\BE\D1\81\D0\BA\D0\BE\D0\B2 = %d\0A\00"
@.str.6 = [28 x i8] c"\D0\92\D1\8B \D0\BF\D1\80\D0\BE\D0\B8\D0\B3\D1\80\D0\B0\D0\BB\D0\B8 :(\0A\00"
@.str.7 = [52 x i8] c"\D0\92\D0\B0\D1\88\D0\B0 \D1\82\D0\B5\D0\BA\D1\83\D1\89\D0\B0\D1\8F \D1\81\D1\83\D0\BC\D0\BC\D0\B0 \D0\B4\D0\B5\D0\BD\D0\B5\D0\B3 = %d\0A\00"
@.str.8 = [33 x i8] c"\D0\A1\D0\B5\D0\B9\D1\87\D0\B0\D1\81 \D0\B2 \D0\B1\D0\B0\D0\BD\D0\BA\D0\B5 = %d\0A\00"
@.str.9 = [47 x i8] c"\D0\96\D0\B5\D0\BB\D0\B0\D0\B5\D1\82\D0\B5 \D0\BF\D1\80\D0\BE\D0\B4\D0\BE\D0\BB\D0\B6\D0\B8\D1\82\D1\8C \D0\B8\D0\B3\D1\80\D1\83?\0A\00"
@.str.10 = [18 x i8] c"1-\D0\94\D0\B0 2-\D0\9D\D0\B5\D1\82\0A\00"
@.str.11 = [46 x i8] c"\D0\9F\D0\BE\D0\B7\D0\B4\D1\80\D0\B0\D0\B2\D0\BB\D1\8F\D0\B5\D0\BC \D0\B2\D1\8B \D0\BF\D0\BE\D0\B1\D0\B5\D0\B4\D0\B8\D0\BB\D0\B8\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
store i32 1000000, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
%9 = load i32, i32* %5
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %96, %0
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 2
br i1 %14, label %15, label %97
15: ; preds = %12
%16 = load i32, i32* %8
%17 = icmp slt i32 %16, 20
br i1 %17, label %18, label %25
18: ; preds = %15
%19 = load i32, i32* %8
%20 = load i32, i32* %3
%21 = call i32 @Random(i32 %20)
%22 = add nsw i32 %19, %21
store i32 %22, i32* %8
%23 = load i32, i32* %2
%24 = add nsw i32 %23, 1
store i32 %24, i32* %2
br label %25
25: ; preds = %18, %15
%26 = load i32, i32* %8
%27 = icmp sgt i32 %26, 20
br i1 %27, label %31, label %28
28: ; preds = %25
%29 = load i32, i32* %8
%30 = icmp eq i32 %29, 20
br i1 %30, label %31, label %34
31: ; preds = %28, %25
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%33 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %6)
br label %34
34: ; preds = %31, %28
%35 = load i32, i32* %8
%36 = icmp sgt i32 %35, 20
br i1 %36, label %37, label %60
37: ; preds = %34
%38 = load i32, i32* %5
%39 = load i32, i32* %6
%40 = add nsw i32 %38, %39
store i32 %40, i32* %5
%41 = load i32, i32* %7
%42 = load i32, i32* %6
%43 = sub nsw i32 %41, %42
store i32 %43, i32* %7
%44 = load i32, i32* %8
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i64 0, i64 0), i32 %44)
%46 = load i32, i32* %2
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i32 %46)
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0))
%49 = load i32, i32* %7
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0), i32 %49)
%51 = load i32, i32* %5
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i64 0, i64 0), i32 %51)
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.9, i64 0, i64 0))
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0))
%55 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %4)
store i32 0, i32* %6
%56 = load i32, i32* %4
%57 = icmp eq i32 %56, 2
br i1 %57, label %58, label %59
58: ; preds = %37
br label %97
59: ; preds = %37
store i32 0, i32* %8
br label %60
60: ; preds = %59, %34
%61 = load i32, i32* %8
%62 = icmp eq i32 %61, 20
br i1 %62, label %63, label %92
63: ; preds = %60
%64 = load i32, i32* %7
%65 = load i32, i32* %6
%66 = mul nsw i32 %65, 2
%67 = add nsw i32 %64, %66
store i32 %67, i32* %7
%68 = load i32, i32* %5
%69 = load i32, i32* %6
%70 = mul nsw i32 %69, 2
%71 = sub nsw i32 %68, %70
store i32 %71, i32* %5
%72 = load i32, i32* %8
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i64 0, i64 0), i32 %72)
%74 = load i32, i32* %2
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i32 %74)
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.11, i64 0, i64 0))
%77 = load i32, i32* %7
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0), i32 %77)
%79 = load i32, i32* %5
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i64 0, i64 0), i32 %79)
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.9, i64 0, i64 0))
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0))
%83 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %4)
%84 = load i32, i32* %4
%85 = icmp eq i32 %84, 2
br i1 %85, label %86, label %87
86: ; preds = %63
br label %97
87: ; preds = %63
store i32 0, i32* %8
store i32 0, i32* %6
%88 = load i32, i32* %4
%89 = icmp eq i32 %88, 2
br i1 %89, label %90, label %91
90: ; preds = %87
br label %97
91: ; preds = %87
br label %92
92: ; preds = %91, %60
%93 = load i32, i32* %4
%94 = icmp eq i32 %93, 2
br i1 %94, label %95, label %96
95: ; preds = %92
br label %97
96: ; preds = %92
br label %12
97: ; preds = %95, %90, %86, %58, %12
ret i32 0
}
define i32 @Random(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 (...) @rand()
%7 = srem i32 %6, 6
%8 = add nsw i32 %5, %7
%9 = add nsw i32 %8, 1
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = call i32 (...) @rand()
%12 = srem i32 %11, 6
%13 = add nsw i32 %10, %12
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
%15 = load i32, i32* %3
store i32 %15, i32* %4
%16 = load i32, i32* %4
ret i32 %16
}

LLVM IR (-O2):
@.str = [31 x i8] c"\D0\A1\D1\83\D0\BC\D0\BC\D0\B0 \D0\B2 \D0\B1\D0\B0\D0\BD\D0\BA\D0\B5 = %d\0A\00"
@.str.2 = [25 x i8] c"\D0\92\D0\B0\D1\88\D0\B0 \D1\81\D1\82\D0\B0\D0\B2\D0\BA\D0\B0 = \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [48 x i8] c"\D0\A1\D1\83\D0\BC\D0\BC\D0\B0 \D0\BE\D1\87\D0\BA\D0\BE\D0\B2 \D0\BD\D0\B0 \D0\BA\D1\83\D0\B1\D0\B8\D0\BA\D0\B0\D1\85 = %d\0A\00"
@.str.5 = [33 x i8] c"\D0\9A\D0\BE\D0\BB-\D0\B2\D0\BE \D0\B1\D1\80\D0\BE\D1\81\D0\BA\D0\BE\D0\B2 = %d\0A\00"
@.str.7 = [52 x i8] c"\D0\92\D0\B0\D1\88\D0\B0 \D1\82\D0\B5\D0\BA\D1\83\D1\89\D0\B0\D1\8F \D1\81\D1\83\D0\BC\D0\BC\D0\B0 \D0\B4\D0\B5\D0\BD\D0\B5\D0\B3 = %d\0A\00"
@.str.8 = [33 x i8] c"\D0\A1\D0\B5\D0\B9\D1\87\D0\B0\D1\81 \D0\B2 \D0\B1\D0\B0\D0\BD\D0\BA\D0\B5 = %d\0A\00"
@str = [45 x i8] c"\D0\9F\D0\BE\D0\B7\D0\B4\D1\80\D0\B0\D0\B2\D0\BB\D1\8F\D0\B5\D0\BC \D0\B2\D1\8B \D0\BF\D0\BE\D0\B1\D0\B5\D0\B4\D0\B8\D0\BB\D0\B8\00"
@str.14 = [27 x i8] c"\D0\92\D1\8B \D0\BF\D1\80\D0\BE\D0\B8\D0\B3\D1\80\D0\B0\D0\BB\D0\B8 :(\00"
@str.15 = [46 x i8] c"\D0\96\D0\B5\D0\BB\D0\B0\D0\B5\D1\82\D0\B5 \D0\BF\D1\80\D0\BE\D0\B4\D0\BE\D0\BB\D0\B6\D0\B8\D1\82\D1\8C \D0\B8\D0\B3\D1\80\D1\83?\00"
@str.16 = [17 x i8] c"1-\D0\94\D0\B0 2-\D0\9D\D0\B5\D1\82\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 1000000)
%6 = tail call i32 @putchar(i32 10)
br label %7
7: ; preds = %0, %60
%8 = phi i32 [ %19, %60 ], [ undef, %0 ]
%9 = phi i32 [ %62, %60 ], [ 1000000, %0 ]
%10 = phi i32 [ %63, %60 ], [ 0, %0 ]
%11 = phi i32 [ %64, %60 ], [ 0, %0 ]
%12 = call i32 (...) @rand()
%13 = srem i32 %12, 6
%14 = call i32 (...) @rand()
%15 = srem i32 %14, 6
%16 = add nsw i32 %11, 2
%17 = add i32 %16, %13
%18 = add i32 %17, %15
%19 = add nsw i32 %8, 1
%20 = icmp sgt i32 %18, 20
%21 = icmp sgt i32 %18, 19
br i1 %21, label %22, label %25
22: ; preds = %7
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %2)
br label %25
25: ; preds = %7, %22
br i1 %20, label %26, label %40
26: ; preds = %25
%27 = load i32, i32* %2
%28 = add nsw i32 %27, %9
%29 = sub nsw i32 %10, %27
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i64 0, i64 0), i32 %18)
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i32 %19)
%32 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.14, i64 0, i64 0))
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0), i32 %29)
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i64 0, i64 0), i32 %28)
%35 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.15, i64 0, i64 0))
%36 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.16, i64 0, i64 0))
%37 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %1)
store i32 0, i32* %2
%38 = load i32, i32* %1
%39 = icmp eq i32 %38, 2
br i1 %39, label %66, label %60
40: ; preds = %25
%41 = icmp eq i32 %18, 20
br i1 %41, label %42, label %58
42: ; preds = %40
%43 = load i32, i32* %2
%44 = shl nsw i32 %43, 1
%45 = add nsw i32 %44, %10
%46 = sub nsw i32 %9, %44
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i64 0, i64 0), i32 20)
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i32 %19)
%49 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0), i32 %45)
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i64 0, i64 0), i32 %46)
%52 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.15, i64 0, i64 0))
%53 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.16, i64 0, i64 0))
%54 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %1)
%55 = load i32, i32* %1
%56 = icmp eq i32 %55, 2
br i1 %56, label %66, label %57
57: ; preds = %42
store i32 0, i32* %2
br label %60
58: ; preds = %40
%59 = load i32, i32* %1
br label %60
60: ; preds = %26, %58, %57
%61 = phi i32 [ %59, %58 ], [ %55, %57 ], [ %38, %26 ]
%62 = phi i32 [ %9, %58 ], [ %46, %57 ], [ %28, %26 ]
%63 = phi i32 [ %10, %58 ], [ %45, %57 ], [ %29, %26 ]
%64 = phi i32 [ %18, %58 ], [ 0, %57 ], [ 0, %26 ]
%65 = icmp eq i32 %61, 2
br i1 %65, label %66, label %7
66: ; preds = %60, %42, %26
ret i32 0
}
define i32 @Random(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, 6
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, 6
%6 = add nsw i32 %3, 2
%7 = add nsw i32 %6, %5
ret i32 %7
}