#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*/ fprintf(int /*<<< orphan*/, char *, int);
void *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int rand();
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  int i, j;
  int x, y;
  int u;
  int rob1_x, rob1_y;
  int rob2_x, rob2_y;
  srand(time(NULL));
  x = rand() % 40 + 10;
  y = rand() % 40 + 10;
  fprintf(
      stderr,
      "Παρακαλώ, εισάγετε ένα ποσοστό κάλυψης με εμπόδια (μεταξύ 1 και %d):\n",
      40 * 40);
  scanf("%d", &u);
  fprintf(stderr, "Θα περίπου το 1/%d του πίνακα.\n", u);
  printf("%d %d\n", x, y);
  rob1_x = rand() % x;
  rob2_x = rand() % x;
  rob1_y = rand() % y;
  rob2_y = rand() % y;
  printf("%d %d\n", rob2_x + 1, rob2_y + 1);
  printf("%d %d\n", rob1_x + 1, rob1_y + 1);
  char **bla;
  bla = malloc(x * sizeof(char *));
  for (i = 0; i < x; i++) {
    bla[i] = malloc(y * sizeof(char));
    for (j = 0; j < y; j++)
      bla[i][j] = 'O';
  }
  for (i = 0; i < x * y / u; i++) {
    int X = rand() % x;
    int Y = rand() % y;
    bla[X][Y] = 'X';
  }
  bla[rob1_x][rob1_y] = 'O';
  bla[rob2_x][rob2_y] = 'O';
  for (i = 0; i < y; i++) {
    for (j = 0; j < x; j++)
      printf("%c", bla[j][i]);
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1090 <rand@plt>
mov    $0x28,%ecx
cltd
idiv   %ecx
add    $0xa,%edx
mov    %edx,-0x10(%rbp)
mov    $0x0,%al
call   1090 <rand@plt>
mov    $0x28,%ecx
cltd
idiv   %ecx
add    $0xa,%edx
mov    %edx,-0x14(%rbp)
mov    0x2e20(%rip),%rax
mov    (%rax),%edi
lea    0xe37(%rip),%rsi
mov    $0x640,%edx
call   1050 <fprintf@plt>
lea    0xe9f(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1080 <scanf@plt>
mov    0x2df6(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%edx
lea    0xe86(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1090 <rand@plt>
cltd
idivl  -0x10(%rbp)
mov    %edx,-0x1c(%rbp)
mov    $0x0,%al
call   1090 <rand@plt>
cltd
idivl  -0x10(%rbp)
mov    %edx,-0x24(%rbp)
mov    $0x0,%al
call   1090 <rand@plt>
cltd
idivl  -0x14(%rbp)
mov    %edx,-0x20(%rbp)
mov    $0x0,%al
call   1090 <rand@plt>
cltd
idivl  -0x14(%rbp)
mov    %edx,-0x28(%rbp)
mov    -0x24(%rbp),%esi
add    $0x1,%esi
mov    -0x28(%rbp),%edx
add    $0x1,%edx
lea    0xe56(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
add    $0x1,%esi
mov    -0x20(%rbp),%edx
add    $0x1,%edx
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x10(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1307 <main+0x197>
movslq -0x14(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,%rdx
mov    -0x30(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    12f4 <main+0x184>
mov    -0x30(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0xc(%rbp),%rcx
movb   $0x4f,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    12c6 <main+0x156>
jmp    12f9 <main+0x189>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1295 <main+0x125>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x14(%rbp),%eax
cltd
idivl  -0x18(%rbp)
mov    %eax,%ecx
mov    -0x3c(%rbp),%eax
cmp    %ecx,%eax
jge    136a <main+0x1fa>
mov    $0x0,%al
call   1090 <rand@plt>
cltd
idivl  -0x10(%rbp)
mov    %edx,-0x34(%rbp)
mov    $0x0,%al
call   1090 <rand@plt>
cltd
idivl  -0x14(%rbp)
mov    %edx,-0x38(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x38(%rbp),%rcx
movb   $0x58,(%rax,%rcx,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    130e <main+0x19e>
mov    -0x30(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
movb   $0x4f,(%rax,%rcx,1)
mov    -0x30(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
movb   $0x4f,(%rax,%rcx,1)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1404 <main+0x294>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    13e8 <main+0x278>
mov    -0x30(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x8(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xce4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    13ac <main+0x23c>
lea    0xcbf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1399 <main+0x229>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
xor    %edi,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
xor    %eax,%eax
call   10b0 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x24,%rcx
add    %edx,%ecx
shl    $0x3,%ecx
lea    (%rcx,%rcx,4),%ecx
mov    %eax,%r15d
sub    %ecx,%r15d
neg    %ecx
lea    (%rax,%rcx,1),%r12d
add    $0xa,%r12d
xor    %eax,%eax
call   10b0 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x24,%rcx
add    %edx,%ecx
shl    $0x3,%ecx
lea    (%rcx,%rcx,4),%ecx
mov    %eax,%edx
sub    %ecx,%edx
mov    %edx,0xc(%rsp)
neg    %ecx
lea    (%rax,%rcx,1),%r13d
add    $0xa,%r13d
mov    0x2dc5(%rip),%r14
mov    (%r14),%edi
lea    0xddb(%rip),%rsi
mov    $0x640,%edx
call   1070 <fprintf@plt>
lea    0xe43(%rip),%rdi
lea    0x8(%rsp),%rsi
call   10a0 <scanf@plt>
mov    (%r14),%edi
mov    0x8(%rsp),%edx
lea    0xe2e(%rip),%rsi
call   1070 <fprintf@plt>
lea    0xe56(%rip),%rdi
mov    %r12d,%esi
mov    %r13d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   10b0 <rand@plt>
cltd
idiv   %r12d
mov    %edx,%ebx
xor    %eax,%eax
call   10b0 <rand@plt>
cltd
idiv   %r12d
mov    %edx,%ebp
xor    %eax,%eax
call   10b0 <rand@plt>
cltd
idiv   %r13d
mov    %edx,%r14d
xor    %eax,%eax
call   10b0 <rand@plt>
cltd
idiv   %r13d
mov    %rbp,0x20(%rsp)
lea    0x1(%rbp),%esi
mov    %rdx,0x10(%rsp)
add    $0x1,%edx
lea    0xdff(%rip),%rbp
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,0x28(%rsp)
lea    0x1(%rbx),%esi
mov    %r14,0x18(%rsp)
lea    0x1(%r14),%edx
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x50(,%r15,8),%edi
call   1090 <malloc@plt>
mov    %r13d,%edi
mov    %rax,%r14
mov    %r15,0x30(%rsp)
cmp    $0xfffffff7,%r15d
mov    %r13d,%ebp
jl     133d <main+0x1ad>
cmp    $0x2,%edi
mov    $0x1,%r13d
cmovge %edi,%r13d
mov    %r12d,%r15d
xor    %ebx,%ebx
jmp    131b <main+0x18b>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    %rbx,%r15
mov    %ebp,%edi
je     133d <main+0x1ad>
call   1090 <malloc@plt>
mov    %rax,(%r14,%rbx,8)
cmpl   $0xfffffff7,0xc(%rsp)
jl     1310 <main+0x180>
mov    %rax,%rdi
mov    $0x4f,%esi
mov    %r13,%rdx
call   1050 <memset@plt>
jmp    1310 <main+0x180>
mov    %edi,%ebx
imul   %r12d,%ebx
mov    %ebx,%eax
cltd
idivl  0x8(%rsp)
test   %eax,%eax
jle    1398 <main+0x208>
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   10b0 <rand@plt>
cltd
idiv   %r12d
mov    %edx,%r13d
xor    %eax,%eax
call   10b0 <rand@plt>
mov    %ebp,%edi
cltd
idiv   %ebp
movslq %r13d,%rax
mov    (%r14,%rax,8),%rax
movslq %edx,%rcx
movb   $0x58,(%rax,%rcx,1)
add    $0x1,%r15d
mov    %ebx,%eax
cltd
idivl  0x8(%rsp)
cmp    %eax,%r15d
jl     1360 <main+0x1d0>
movslq 0x28(%rsp),%rax
mov    (%r14,%rax,8),%rax
movslq 0x18(%rsp),%rcx
movb   $0x4f,(%rax,%rcx,1)
movslq 0x20(%rsp),%rax
mov    (%r14,%rax,8),%rax
movslq 0x10(%rsp),%rcx
movb   $0x4f,(%rax,%rcx,1)
cmpl   $0xfffffff7,0xc(%rsp)
mov    0x30(%rsp),%r13
jl     1428 <main+0x298>
cmp    $0x2,%r12d
mov    $0x1,%r15d
cmovl  %r15d,%r12d
cmp    $0x2,%edi
cmovge %edi,%r15d
xor    %ebx,%ebx
jmp    1403 <main+0x273>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %r15,%rbx
je     1428 <main+0x298>
cmp    $0xfffffff7,%r13d
jl     13f0 <main+0x260>
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbp,8),%rax
movsbl (%rax,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbp
cmp    %rbp,%r12
jne    1410 <main+0x280>
jmp    13f0 <main+0x260>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [121 x i8] c"\CE\A0\CE\B1\CF\81\CE\B1\CE\BA\CE\B1\CE\BB\CF\8E, \CE\B5\CE\B9\CF\83\CE\AC\CE\B3\CE\B5\CF\84\CE\B5 \CE\AD\CE\BD\CE\B1 \CF\80\CE\BF\CF\83\CE\BF\CF\83\CF\84\CF\8C \CE\BA\CE\AC\CE\BB\CF\85\CF\88\CE\B7\CF\82 \CE\BC\CE\B5 \CE\B5\CE\BC\CF\80\CF\8C\CE\B4\CE\B9\CE\B1 (\CE\BC\CE\B5\CF\84\CE\B1\CE\BE\CF\8D 1 \CE\BA\CE\B1\CE\B9 %d):\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [52 x i8] c"\CE\98\CE\B1 \CF\80\CE\B5\CF\81\CE\AF\CF\80\CE\BF\CF\85 \CF\84\CE\BF 1/%d \CF\84\CE\BF\CF\85 \CF\80\CE\AF\CE\BD\CE\B1\CE\BA\CE\B1.\0A\00"
@.str.3 = [7 x i8] c"%d %d\0A\00"
@.str.4 = [3 x i8] c"%c\00"
@.str.5 = [2 x i8] c"\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
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8**
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %1
%14 = call i32 @time(i32* null)
%15 = call i32 @srand(i32 %14)
%16 = call i32 (...) @rand()
%17 = srem i32 %16, 40
%18 = add nsw i32 %17, 10
store i32 %18, i32* %4
%19 = call i32 (...) @rand()
%20 = srem i32 %19, 40
%21 = add nsw i32 %20, 10
store i32 %21, i32* %5
%22 = load i32, i32* @stderr
%23 = call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([121 x i8], [121 x i8]* @.str, i64 0, i64 0), i32 1600)
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%25 = load i32, i32* @stderr
%26 = load i32, i32* %6
%27 = call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0), i32 %26)
%28 = load i32, i32* %4
%29 = load i32, i32* %5
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %28, i32 %29)
%31 = call i32 (...) @rand()
%32 = load i32, i32* %4
%33 = srem i32 %31, %32
store i32 %33, i32* %7
%34 = call i32 (...) @rand()
%35 = load i32, i32* %4
%36 = srem i32 %34, %35
store i32 %36, i32* %9
%37 = call i32 (...) @rand()
%38 = load i32, i32* %5
%39 = srem i32 %37, %38
store i32 %39, i32* %8
%40 = call i32 (...) @rand()
%41 = load i32, i32* %5
%42 = srem i32 %40, %41
store i32 %42, i32* %10
%43 = load i32, i32* %9
%44 = add nsw i32 %43, 1
%45 = load i32, i32* %10
%46 = add nsw i32 %45, 1
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %44, i32 %46)
%48 = load i32, i32* %7
%49 = add nsw i32 %48, 1
%50 = load i32, i32* %8
%51 = add nsw i32 %50, 1
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %49, i32 %51)
%53 = load i32, i32* %4
%54 = sext i32 %53 to i64
%55 = mul i64 %54, 8
%56 = trunc i64 %55 to i32
%57 = call i8* @malloc(i32 %56)
%58 = bitcast i8* %57 to i8**
store i8** %58, i8*** %11
store i32 0, i32* %2
br label %59
59: ; preds = %90, %0
%60 = load i32, i32* %2
%61 = load i32, i32* %4
%62 = icmp slt i32 %60, %61
br i1 %62, label %63, label %93
63: ; preds = %59
%64 = load i32, i32* %5
%65 = sext i32 %64 to i64
%66 = mul i64 %65, 1
%67 = trunc i64 %66 to i32
%68 = call i8* @malloc(i32 %67)
%69 = load i8**, i8*** %11
%70 = load i32, i32* %2
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds i8*, i8** %69, i64 %71
store i8* %68, i8** %72
store i32 0, i32* %3
br label %73
73: ; preds = %86, %63
%74 = load i32, i32* %3
%75 = load i32, i32* %5
%76 = icmp slt i32 %74, %75
br i1 %76, label %77, label %89
77: ; preds = %73
%78 = load i8**, i8*** %11
%79 = load i32, i32* %2
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds i8*, i8** %78, i64 %80
%82 = load i8*, i8** %81
%83 = load i32, i32* %3
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds i8, i8* %82, i64 %84
store i8 79, i8* %85
br label %86
86: ; preds = %77
%87 = load i32, i32* %3
%88 = add nsw i32 %87, 1
store i32 %88, i32* %3
br label %73
89: ; preds = %73
br label %90
90: ; preds = %89
%91 = load i32, i32* %2
%92 = add nsw i32 %91, 1
store i32 %92, i32* %2
br label %59
93: ; preds = %59
store i32 0, i32* %2
br label %94
94: ; preds = %117, %93
%95 = load i32, i32* %2
%96 = load i32, i32* %4
%97 = load i32, i32* %5
%98 = mul nsw i32 %96, %97
%99 = load i32, i32* %6
%100 = sdiv i32 %98, %99
%101 = icmp slt i32 %95, %100
br i1 %101, label %102, label %120
102: ; preds = %94
%103 = call i32 (...) @rand()
%104 = load i32, i32* %4
%105 = srem i32 %103, %104
store i32 %105, i32* %12
%106 = call i32 (...) @rand()
%107 = load i32, i32* %5
%108 = srem i32 %106, %107
store i32 %108, i32* %13
%109 = load i8**, i8*** %11
%110 = load i32, i32* %12
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds i8*, i8** %109, i64 %111
%113 = load i8*, i8** %112
%114 = load i32, i32* %13
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds i8, i8* %113, i64 %115
store i8 88, i8* %116
br label %117
117: ; preds = %102
%118 = load i32, i32* %2
%119 = add nsw i32 %118, 1
store i32 %119, i32* %2
br label %94
120: ; preds = %94
%121 = load i8**, i8*** %11
%122 = load i32, i32* %7
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds i8*, i8** %121, i64 %123
%125 = load i8*, i8** %124
%126 = load i32, i32* %8
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds i8, i8* %125, i64 %127
store i8 79, i8* %128
%129 = load i8**, i8*** %11
%130 = load i32, i32* %9
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds i8*, i8** %129, i64 %131
%133 = load i8*, i8** %132
%134 = load i32, i32* %10
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds i8, i8* %133, i64 %135
store i8 79, i8* %136
store i32 0, i32* %2
br label %137
137: ; preds = %163, %120
%138 = load i32, i32* %2
%139 = load i32, i32* %5
%140 = icmp slt i32 %138, %139
br i1 %140, label %141, label %166
141: ; preds = %137
store i32 0, i32* %3
br label %142
142: ; preds = %158, %141
%143 = load i32, i32* %3
%144 = load i32, i32* %4
%145 = icmp slt i32 %143, %144
br i1 %145, label %146, label %161
146: ; preds = %142
%147 = load i8**, i8*** %11
%148 = load i32, i32* %3
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds i8*, i8** %147, i64 %149
%151 = load i8*, i8** %150
%152 = load i32, i32* %2
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds i8, i8* %151, i64 %153
%155 = load i8, i8* %154
%156 = sext i8 %155 to i32
%157 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %156)
br label %158
158: ; preds = %146
%159 = load i32, i32* %3
%160 = add nsw i32 %159, 1
store i32 %160, i32* %3
br label %142
161: ; preds = %142
%162 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %163
163: ; preds = %161
%164 = load i32, i32* %2
%165 = add nsw i32 %164, 1
store i32 %165, i32* %2
br label %137
166: ; preds = %137
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [121 x i8] c"\CE\A0\CE\B1\CF\81\CE\B1\CE\BA\CE\B1\CE\BB\CF\8E, \CE\B5\CE\B9\CF\83\CE\AC\CE\B3\CE\B5\CF\84\CE\B5 \CE\AD\CE\BD\CE\B1 \CF\80\CE\BF\CF\83\CE\BF\CF\83\CF\84\CF\8C \CE\BA\CE\AC\CE\BB\CF\85\CF\88\CE\B7\CF\82 \CE\BC\CE\B5 \CE\B5\CE\BC\CF\80\CF\8C\CE\B4\CE\B9\CE\B1 (\CE\BC\CE\B5\CF\84\CE\B1\CE\BE\CF\8D 1 \CE\BA\CE\B1\CE\B9 %d):\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [52 x i8] c"\CE\98\CE\B1 \CF\80\CE\B5\CF\81\CE\AF\CF\80\CE\BF\CF\85 \CF\84\CE\BF 1/%d \CF\84\CE\BF\CF\85 \CF\80\CE\AF\CE\BD\CE\B1\CE\BA\CE\B1.\0A\00"
@.str.3 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 40
%7 = add nsw i32 %6, 10
%8 = tail call i32 (...) @rand()
%9 = srem i32 %8, 40
%10 = add nsw i32 %9, 10
%11 = load i32, i32* @stderr
%12 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([121 x i8], [121 x i8]* @.str, i64 0, i64 0), i32 1600)
%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* @stderr
%15 = load i32, i32* %1
%16 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0), i32 %15)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %7, i32 %10)
%18 = call i32 (...) @rand()
%19 = srem i32 %18, %7
%20 = call i32 (...) @rand()
%21 = srem i32 %20, %7
%22 = call i32 (...) @rand()
%23 = srem i32 %22, %10
%24 = call i32 (...) @rand()
%25 = srem i32 %24, %10
%26 = add nsw i32 %21, 1
%27 = add nsw i32 %25, 1
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %26, i32 %27)
%29 = add nsw i32 %19, 1
%30 = add nsw i32 %23, 1
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %29, i32 %30)
%32 = shl nsw i32 %7, 3
%33 = call i8* @malloc(i32 %32)
%34 = bitcast i8* %33 to i8**
%35 = icmp sgt i32 %6, -10
br i1 %35, label %36, label %41
36: ; preds = %0
%37 = icmp sgt i32 %9, -10
%38 = call i32 @llvm.smax.i32(i32 %10, i32 1)
%39 = zext i32 %38 to i64
%40 = zext i32 %7 to i64
br label %46
41: ; preds = %51, %0
%42 = mul nsw i32 %10, %7
%43 = load i32, i32* %1
%44 = sdiv i32 %42, %43
%45 = icmp sgt i32 %44, 0
br i1 %45, label %54, label %69
46: ; preds = %36, %51
%47 = phi i64 [ 0, %36 ], [ %52, %51 ]
%48 = call i8* @malloc(i32 %10)
%49 = getelementptr inbounds i8*, i8** %34, i64 %47
store i8* %48, i8** %49
br i1 %37, label %50, label %51
50: ; preds = %46
br label %51
51: ; preds = %50, %46
%52 = add nuw nsw i64 %47, 1
%53 = icmp eq i64 %52, %40
br i1 %53, label %41, label %46
54: ; preds = %41, %54
%55 = phi i32 [ %65, %54 ], [ 0, %41 ]
%56 = call i32 (...) @rand()
%57 = srem i32 %56, %7
%58 = call i32 (...) @rand()
%59 = srem i32 %58, %10
%60 = sext i32 %57 to i64
%61 = getelementptr inbounds i8*, i8** %34, i64 %60
%62 = load i8*, i8** %61
%63 = sext i32 %59 to i64
%64 = getelementptr inbounds i8, i8* %62, i64 %63
store i8 88, i8* %64
%65 = add nuw nsw i32 %55, 1
%66 = load i32, i32* %1
%67 = sdiv i32 %42, %66
%68 = icmp slt i32 %65, %67
br i1 %68, label %54, label %69
69: ; preds = %54, %41
%70 = sext i32 %19 to i64
%71 = getelementptr inbounds i8*, i8** %34, i64 %70
%72 = load i8*, i8** %71
%73 = sext i32 %23 to i64
%74 = getelementptr inbounds i8, i8* %72, i64 %73
store i8 79, i8* %74
%75 = sext i32 %21 to i64
%76 = getelementptr inbounds i8*, i8** %34, i64 %75
%77 = load i8*, i8** %76
%78 = sext i32 %25 to i64
%79 = getelementptr inbounds i8, i8* %77, i64 %78
store i8 79, i8* %79
%80 = icmp sgt i32 %9, -10
br i1 %80, label %81, label %102
81: ; preds = %69
%82 = call i32 @llvm.smax.i32(i32 %7, i32 1)
%83 = call i32 @llvm.smax.i32(i32 %10, i32 1)
%84 = zext i32 %83 to i64
%85 = zext i32 %82 to i64
br label %86
86: ; preds = %81, %98
%87 = phi i64 [ 0, %81 ], [ %100, %98 ]
br i1 %35, label %88, label %98
88: ; preds = %86, %88
%89 = phi i64 [ %96, %88 ], [ 0, %86 ]
%90 = getelementptr inbounds i8*, i8** %34, i64 %89
%91 = load i8*, i8** %90
%92 = getelementptr inbounds i8, i8* %91, i64 %87
%93 = load i8, i8* %92
%94 = sext i8 %93 to i32
%95 = call i32 @putchar(i32 %94)
%96 = add nuw nsw i64 %89, 1
%97 = icmp eq i64 %96, %85
br i1 %97, label %98, label %88
98: ; preds = %88, %86
%99 = call i32 @putchar(i32 10)
%100 = add nuw nsw i64 %87, 1
%101 = icmp eq i64 %100, %84
br i1 %101, label %102, label %86
102: ; preds = %98, %69
ret i32 0
}