#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 i, k;
  for (i = 0; i < 22; i++)
    for (k = 0; k < 21; k++)
      draw_field(to_point(k, i));
}


x86 assembly (clang, -O0):
<draw_board>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x16,-0x4(%rbp)
jge    117d <draw_board+0x5d>
movl   $0x0,-0x8(%rbp)
cmpl   $0x15,-0x8(%rbp)
jge    116a <draw_board+0x4a>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1040 <to_point@plt>
mov    %eax,%edi
call   1030 <draw_field@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1140 <draw_board+0x20>
jmp    116f <draw_board+0x4f>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%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>
mov    $0xa,%edi
mov    %ebx,%esi
call   1040 <to_point@plt>
mov    %eax,%edi
call   1030 <draw_field@plt>
mov    $0xb,%edi
mov    %ebx,%esi
call   1040 <to_point@plt>
mov    %eax,%edi
call   1030 <draw_field@plt>
mov    $0xc,%edi
mov    %ebx,%esi
call   1040 <to_point@plt>
mov    %eax,%edi
call   1030 <draw_field@plt>
mov    $0xd,%edi
mov    %ebx,%esi
call   1040 <to_point@plt>
mov    %eax,%edi
call   1030 <draw_field@plt>
mov    $0xe,%edi
mov    %ebx,%esi
call   1040 <to_point@plt>
mov    %eax,%edi
call   1030 <draw_field@plt>
mov    $0xf,%edi
mov    %ebx,%esi
call   1040 <to_point@plt>
mov    %eax,%edi
call   1030 <draw_field@plt>
mov    $0x10,%edi
mov    %ebx,%esi
call   1040 <to_point@plt>
mov    %eax,%edi
call   1030 <draw_field@plt>
mov    $0x11,%edi
mov    %ebx,%esi
call   1040 <to_point@plt>
mov    %eax,%edi
call   1030 <draw_field@plt>
mov    $0x12,%edi
mov    %ebx,%esi
call   1040 <to_point@plt>
mov    %eax,%edi
call   1030 <draw_field@plt>
mov    $0x13,%edi
mov    %ebx,%esi
call   1040 <to_point@plt>
mov    %eax,%edi
call   1030 <draw_field@plt>
mov    $0x14,%edi
mov    %ebx,%esi
call   1040 <to_point@plt>
mov    %eax,%edi
call   1030 <draw_field@plt>
add    $0x1,%ebx
cmp    $0x16,%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* %1
br label %3
3: ; preds = %19, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 22
br i1 %5, label %6, label %22
6: ; preds = %3
store i32 0, i32* %2
br label %7
7: ; preds = %15, %6
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 21
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = load i32, i32* %2
%12 = load i32, i32* %1
%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* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %7
18: ; preds = %7
br label %19
19: ; preds = %18
%20 = load i32, i32* %1
%21 = add nsw i32 %20, 1
store i32 %21, i32* %1
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 ], [ %45, %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 = tail call i32 @to_point(i32 10, i32 %2)
%24 = tail call i32 @draw_field(i32 %23)
%25 = tail call i32 @to_point(i32 11, i32 %2)
%26 = tail call i32 @draw_field(i32 %25)
%27 = tail call i32 @to_point(i32 12, i32 %2)
%28 = tail call i32 @draw_field(i32 %27)
%29 = tail call i32 @to_point(i32 13, i32 %2)
%30 = tail call i32 @draw_field(i32 %29)
%31 = tail call i32 @to_point(i32 14, i32 %2)
%32 = tail call i32 @draw_field(i32 %31)
%33 = tail call i32 @to_point(i32 15, i32 %2)
%34 = tail call i32 @draw_field(i32 %33)
%35 = tail call i32 @to_point(i32 16, i32 %2)
%36 = tail call i32 @draw_field(i32 %35)
%37 = tail call i32 @to_point(i32 17, i32 %2)
%38 = tail call i32 @draw_field(i32 %37)
%39 = tail call i32 @to_point(i32 18, i32 %2)
%40 = tail call i32 @draw_field(i32 %39)
%41 = tail call i32 @to_point(i32 19, i32 %2)
%42 = tail call i32 @draw_field(i32 %41)
%43 = tail call i32 @to_point(i32 20, i32 %2)
%44 = tail call i32 @draw_field(i32 %43)
%45 = add nuw nsw i32 %2, 1
%46 = icmp eq i32 %45, 22
br i1 %46, label %47, label %1
47: ; preds = %1
ret void
}