#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*/ down(int, int, int);
int /*<<< orphan*/ downright(int, int, int);
int /*<<< orphan*/ maximize(int *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ right(int, int, int);
int /*<<< orphan*/ upright(int, int, int);
int main() {
  int prod = 0;
  int r, c;
  for (r = 0; r < 20; r++)
    for (c = 0; c < 20; c++) {
      maximize(&prod, right(r, c, 4));
      maximize(&prod, down(r, c, 4));
      maximize(&prod, downright(r, c, 4));
      maximize(&prod, upright(r, c, 4));
    }
  printf("%d\n", prod);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x14,-0xc(%rbp)
jge    1225 <main+0xc5>
movl   $0x0,-0x10(%rbp)
cmpl   $0x14,-0x10(%rbp)
jge    1212 <main+0xb2>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    $0x4,%edx
call   1040 <right@plt>
mov    %eax,%esi
lea    -0x8(%rbp),%rdi
call   1060 <maximize@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    $0x4,%edx
call   1070 <down@plt>
mov    %eax,%esi
lea    -0x8(%rbp),%rdi
call   1060 <maximize@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    $0x4,%edx
call   1080 <downright@plt>
mov    %eax,%esi
lea    -0x8(%rbp),%rdi
call   1060 <maximize@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    $0x4,%edx
call   1030 <upright@plt>
mov    %eax,%esi
lea    -0x8(%rbp),%rdi
call   1060 <maximize@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    118e <main+0x2e>
jmp    1217 <main+0xb7>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    117d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xdd1(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
xor    %ebx,%ebx
lea    0xc(%rsp),%r14
nopw   0x0(%rax,%rax,1)
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x4,%edx
call   1040 <right@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1060 <maximize@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x4,%edx
call   1070 <down@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1060 <maximize@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x4,%edx
call   1080 <downright@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1060 <maximize@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x4,%edx
call   1030 <upright@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1060 <maximize@plt>
add    $0x1,%ebp
cmp    $0x14,%ebp
jne    1190 <main+0x30>
add    $0x1,%ebx
cmp    $0x14,%ebx
jne    1180 <main+0x20>
mov    0xc(%rsp),%esi
lea    0xdf5(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
br label %5
5: ; preds = %33, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 20
br i1 %7, label %8, label %36
8: ; preds = %5
store i32 0, i32* %4
br label %9
9: ; preds = %29, %8
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 20
br i1 %11, label %12, label %32
12: ; preds = %9
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = call i32 @right(i32 %13, i32 %14, i32 4)
%16 = call i32 @maximize(i32* %2, i32 %15)
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = call i32 @down(i32 %17, i32 %18, i32 4)
%20 = call i32 @maximize(i32* %2, i32 %19)
%21 = load i32, i32* %3
%22 = load i32, i32* %4
%23 = call i32 @downright(i32 %21, i32 %22, i32 4)
%24 = call i32 @maximize(i32* %2, i32 %23)
%25 = load i32, i32* %3
%26 = load i32, i32* %4
%27 = call i32 @upright(i32 %25, i32 %26, i32 4)
%28 = call i32 @maximize(i32* %2, i32 %27)
br label %29
29: ; preds = %12
%30 = load i32, i32* %4
%31 = add nsw i32 %30, 1
store i32 %31, i32* %4
br label %9
32: ; preds = %9
br label %33
33: ; preds = %32
%34 = load i32, i32* %3
%35 = add nsw i32 %34, 1
store i32 %35, i32* %3
br label %5
36: ; preds = %5
%37 = load i32, i32* %2
%38 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %37)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
br label %3
3: ; preds = %0, %17
%4 = phi i32 [ 0, %0 ], [ %18, %17 ]
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ 0, %3 ], [ %15, %5 ]
%7 = call i32 @right(i32 %4, i32 %6, i32 4)
%8 = call i32 @maximize(i32* %1, i32 %7)
%9 = call i32 @down(i32 %4, i32 %6, i32 4)
%10 = call i32 @maximize(i32* %1, i32 %9)
%11 = call i32 @downright(i32 %4, i32 %6, i32 4)
%12 = call i32 @maximize(i32* %1, i32 %11)
%13 = call i32 @upright(i32 %4, i32 %6, i32 4)
%14 = call i32 @maximize(i32* %1, i32 %13)
%15 = add nuw nsw i32 %6, 1
%16 = icmp eq i32 %15, 20
br i1 %16, label %17, label %5
17: ; preds = %5
%18 = add nuw nsw i32 %4, 1
%19 = icmp eq i32 %18, 20
br i1 %19, label %20, label %3
20: ; preds = %17
%21 = load i32, i32* %1
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %21)
ret i32 0
}