#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*/ draw_field(int /*<<< orphan*/);
int /*<<< orphan*/ to_point(int, int);
void draw_board() {
  int x, y;
  for (y = 0; y < 20; y++)
    for (x = 0; x < 10; x++)
      draw_field(to_point(x, y));
}


x86 assembly (clang, -O0):
<draw_board>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jge    117d <draw_board+0x5d>
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    116a <draw_board+0x4a>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <to_point@plt>
mov    %eax,%edi
call   1030 <draw_field@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1140 <draw_board+0x20>
jmp    116f <draw_board+0x4f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <draw_board+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_board>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %edi,%edi
mov    %ebx,%esi
call   1040 <to_point@plt>
mov    %eax,%edi
call   1030 <draw_field@plt>
mov    $0x1,%edi
mov    %ebx,%esi
call   1040 <to_point@plt>
mov    %eax,%edi
call   1030 <draw_field@plt>
mov    $0x2,%edi
mov    %ebx,%esi
call   1040 <to_point@plt>
mov    %eax,%edi
call   1030 <draw_field@plt>
mov    $0x3,%edi
mov    %ebx,%esi
call   1040 <to_point@plt>
mov    %eax,%edi
call   1030 <draw_field@plt>
mov    $0x4,%edi
mov    %ebx,%esi
call   1040 <to_point@plt>
mov    %eax,%edi
call   1030 <draw_field@plt>
mov    $0x5,%edi
mov    %ebx,%esi
call   1040 <to_point@plt>
mov    %eax,%edi
call   1030 <draw_field@plt>
mov    $0x6,%edi
mov    %ebx,%esi
call   1040 <to_point@plt>
mov    %eax,%edi
call   1030 <draw_field@plt>
mov    $0x7,%edi
mov    %ebx,%esi
call   1040 <to_point@plt>
mov    %eax,%edi
call   1030 <draw_field@plt>
mov    $0x8,%edi
mov    %ebx,%esi
call   1040 <to_point@plt>
mov    %eax,%edi
call   1030 <draw_field@plt>
mov    $0x9,%edi
mov    %ebx,%esi
call   1040 <to_point@plt>
mov    %eax,%edi
call   1030 <draw_field@plt>
add    $0x1,%ebx
cmp    $0x14,%ebx
jne    1130 <draw_board+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @draw_board() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %19, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 20
br i1 %5, label %6, label %22
6: ; preds = %3
store i32 0, i32* %1
br label %7
7: ; preds = %15, %6
%8 = load i32, i32* %1
%9 = icmp slt i32 %8, 10
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = load i32, i32* %1
%12 = load i32, i32* %2
%13 = call i32 @to_point(i32 %11, i32 %12)
%14 = call i32 @draw_field(i32 %13)
br label %15
15: ; preds = %10
%16 = load i32, i32* %1
%17 = add nsw i32 %16, 1
store i32 %17, i32* %1
br label %7
18: ; preds = %7
br label %19
19: ; preds = %18
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
br label %3
22: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @draw_board() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %23, %1 ]
%3 = tail call i32 @to_point(i32 0, i32 %2)
%4 = tail call i32 @draw_field(i32 %3)
%5 = tail call i32 @to_point(i32 1, i32 %2)
%6 = tail call i32 @draw_field(i32 %5)
%7 = tail call i32 @to_point(i32 2, i32 %2)
%8 = tail call i32 @draw_field(i32 %7)
%9 = tail call i32 @to_point(i32 3, i32 %2)
%10 = tail call i32 @draw_field(i32 %9)
%11 = tail call i32 @to_point(i32 4, i32 %2)
%12 = tail call i32 @draw_field(i32 %11)
%13 = tail call i32 @to_point(i32 5, i32 %2)
%14 = tail call i32 @draw_field(i32 %13)
%15 = tail call i32 @to_point(i32 6, i32 %2)
%16 = tail call i32 @draw_field(i32 %15)
%17 = tail call i32 @to_point(i32 7, i32 %2)
%18 = tail call i32 @draw_field(i32 %17)
%19 = tail call i32 @to_point(i32 8, i32 %2)
%20 = tail call i32 @draw_field(i32 %19)
%21 = tail call i32 @to_point(i32 9, i32 %2)
%22 = tail call i32 @draw_field(i32 %21)
%23 = add nuw nsw i32 %2, 1
%24 = icmp eq i32 %23, 20
br i1 %24, label %25, label %1
25: ; preds = %1
ret void
}