#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*/ switchCoord(int, int);
void tourner() {
  int c, l, marge;
  int bord_gauche = 17 - 13;
  int bord_droit = 17 - 4;
  int bord_haut = 17 - 4;
  int bord_bas = 17 - 1;
  int l_pointe = 9;
  int c_pointe = 8;
  for (c = bord_gauche; c < bord_droit; c++) {
    for (l = bord_haut; l <= bord_bas; l++) {
      switchCoord(c, l);
    }
  }
  for (l = bord_haut - 1, marge = 1; l >= l_pointe || c <= c_pointe;
       l--, marge++) {
    for (c = bord_gauche + marge; c <= bord_droit - marge; c++) {
      switchCoord(c, l);
    }
  }
}


x86 assembly (clang, -O0):
<tourner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x4,-0x10(%rbp)
movl   $0xd,-0x14(%rbp)
movl   $0xd,-0x18(%rbp)
movl   $0x10,-0x1c(%rbp)
movl   $0x9,-0x20(%rbp)
movl   $0x8,-0x24(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1192 <tourner+0x82>
mov    -0x18(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     117f <tourner+0x6f>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <switchCoord@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115a <tourner+0x4a>
jmp    1184 <tourner+0x74>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1148 <tourner+0x38>
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%al
cmp    -0x20(%rbp),%ecx
mov    %al,-0x25(%rbp)
jge    11bf <tourner+0xaf>
mov    -0x4(%rbp),%eax
cmp    -0x24(%rbp),%eax
setle  %al
mov    %al,-0x25(%rbp)
mov    -0x25(%rbp),%al
test   $0x1,%al
jne    11cf <tourner+0xbf>
jmp    121e <tourner+0x10e>
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    -0xc(%rbp),%ecx
cmp    %ecx,%eax
jg     1202 <tourner+0xf2>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <switchCoord@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11d8 <tourner+0xc8>
jmp    1207 <tourner+0xf7>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11a2 <tourner+0x92>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tourner>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0xd,%r14d
mov    $0x4,%edi
mov    $0xd,%esi
call   1030 <switchCoord@plt>
mov    $0x4,%edi
mov    $0xe,%esi
call   1030 <switchCoord@plt>
mov    $0x4,%edi
mov    $0xf,%esi
call   1030 <switchCoord@plt>
mov    $0x4,%edi
mov    $0x10,%esi
call   1030 <switchCoord@plt>
mov    $0x5,%edi
mov    $0xd,%esi
call   1030 <switchCoord@plt>
mov    $0x5,%edi
mov    $0xe,%esi
call   1030 <switchCoord@plt>
mov    $0x5,%edi
mov    $0xf,%esi
call   1030 <switchCoord@plt>
mov    $0x5,%edi
mov    $0x10,%esi
call   1030 <switchCoord@plt>
mov    $0x6,%edi
mov    $0xd,%esi
call   1030 <switchCoord@plt>
mov    $0x6,%edi
mov    $0xe,%esi
call   1030 <switchCoord@plt>
mov    $0x6,%edi
mov    $0xf,%esi
call   1030 <switchCoord@plt>
mov    $0x6,%edi
mov    $0x10,%esi
call   1030 <switchCoord@plt>
mov    $0x7,%edi
mov    $0xd,%esi
call   1030 <switchCoord@plt>
mov    $0x7,%edi
mov    $0xe,%esi
call   1030 <switchCoord@plt>
mov    $0x7,%edi
mov    $0xf,%esi
call   1030 <switchCoord@plt>
mov    $0x7,%edi
mov    $0x10,%esi
call   1030 <switchCoord@plt>
mov    $0x8,%r15d
mov    $0x8,%edi
mov    $0xd,%esi
call   1030 <switchCoord@plt>
mov    $0x8,%edi
mov    $0xe,%esi
call   1030 <switchCoord@plt>
mov    $0x8,%edi
mov    $0xf,%esi
call   1030 <switchCoord@plt>
mov    $0x8,%edi
mov    $0x10,%esi
call   1030 <switchCoord@plt>
mov    $0x9,%edi
mov    $0xd,%esi
call   1030 <switchCoord@plt>
mov    $0x9,%edi
mov    $0xe,%esi
call   1030 <switchCoord@plt>
mov    $0x9,%edi
mov    $0xf,%esi
call   1030 <switchCoord@plt>
mov    $0x9,%edi
mov    $0x10,%esi
call   1030 <switchCoord@plt>
mov    $0xa,%edi
mov    $0xd,%esi
call   1030 <switchCoord@plt>
mov    $0xa,%edi
mov    $0xe,%esi
call   1030 <switchCoord@plt>
mov    $0xa,%edi
mov    $0xf,%esi
call   1030 <switchCoord@plt>
mov    $0xa,%edi
mov    $0x10,%esi
call   1030 <switchCoord@plt>
mov    $0xb,%edi
mov    $0xd,%esi
call   1030 <switchCoord@plt>
mov    $0xb,%edi
mov    $0xe,%esi
call   1030 <switchCoord@plt>
mov    $0xb,%edi
mov    $0xf,%esi
call   1030 <switchCoord@plt>
mov    $0xb,%edi
mov    $0x10,%esi
call   1030 <switchCoord@plt>
mov    $0xc,%r13d
mov    $0xc,%edi
mov    $0xd,%esi
call   1030 <switchCoord@plt>
mov    $0xc,%edi
mov    $0xe,%esi
call   1030 <switchCoord@plt>
mov    $0xc,%edi
mov    $0xf,%esi
call   1030 <switchCoord@plt>
mov    $0xc,%edi
mov    $0x10,%esi
call   1030 <switchCoord@plt>
mov    $0x1,%r12d
nop
lea    0x4(%r12),%ebp
mov    $0xd,%eax
sub    %r12d,%eax
cmp    %eax,%ebp
jg     1385 <tourner+0x275>
mov    %r15d,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebp,%edi
mov    %r13d,%esi
call   1030 <switchCoord@plt>
add    $0x1,%ebp
add    $0xffffffff,%ebx
jne    1370 <tourner+0x260>
mov    %r14d,%ebp
lea    -0x1(%r13),%eax
add    $0x1,%r12d
add    $0xffffffff,%r14d
add    $0xfffffffe,%r15d
cmp    $0x9,%r13d
mov    %eax,%r13d
jg     1350 <tourner+0x240>
mov    %eax,%r13d
cmp    $0x9,%ebp
jl     1350 <tourner+0x240>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @tourner() {
%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
store i32 4, i32* %4
store i32 13, i32* %5
store i32 13, i32* %6
store i32 16, i32* %7
store i32 9, i32* %8
store i32 8, i32* %9
%10 = load i32, i32* %4
store i32 %10, i32* %1
br label %11
11: ; preds = %29, %0
%12 = load i32, i32* %1
%13 = load i32, i32* %5
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %32
15: ; preds = %11
%16 = load i32, i32* %6
store i32 %16, i32* %2
br label %17
17: ; preds = %25, %15
%18 = load i32, i32* %2
%19 = load i32, i32* %7
%20 = icmp sle i32 %18, %19
br i1 %20, label %21, label %28
21: ; preds = %17
%22 = load i32, i32* %1
%23 = load i32, i32* %2
%24 = call i32 @switchCoord(i32 %22, i32 %23)
br label %25
25: ; preds = %21
%26 = load i32, i32* %2
%27 = add nsw i32 %26, 1
store i32 %27, i32* %2
br label %17
28: ; preds = %17
br label %29
29: ; preds = %28
%30 = load i32, i32* %1
%31 = add nsw i32 %30, 1
store i32 %31, i32* %1
br label %11
32: ; preds = %11
%33 = load i32, i32* %6
%34 = sub nsw i32 %33, 1
store i32 %34, i32* %2
store i32 1, i32* %3
br label %35
35: ; preds = %63, %32
%36 = load i32, i32* %2
%37 = load i32, i32* %8
%38 = icmp sge i32 %36, %37
br i1 %38, label %43, label %39
39: ; preds = %35
%40 = load i32, i32* %1
%41 = load i32, i32* %9
%42 = icmp sle i32 %40, %41
br label %43
43: ; preds = %39, %35
%44 = phi i1 [ true, %35 ], [ %42, %39 ]
br i1 %44, label %45, label %68
45: ; preds = %43
%46 = load i32, i32* %4
%47 = load i32, i32* %3
%48 = add nsw i32 %46, %47
store i32 %48, i32* %1
br label %49
49: ; preds = %59, %45
%50 = load i32, i32* %1
%51 = load i32, i32* %5
%52 = load i32, i32* %3
%53 = sub nsw i32 %51, %52
%54 = icmp sle i32 %50, %53
br i1 %54, label %55, label %62
55: ; preds = %49
%56 = load i32, i32* %1
%57 = load i32, i32* %2
%58 = call i32 @switchCoord(i32 %56, i32 %57)
br label %59
59: ; preds = %55
%60 = load i32, i32* %1
%61 = add nsw i32 %60, 1
store i32 %61, i32* %1
br label %49
62: ; preds = %49
br label %63
63: ; preds = %62
%64 = load i32, i32* %2
%65 = add nsw i32 %64, -1
store i32 %65, i32* %2
%66 = load i32, i32* %3
%67 = add nsw i32 %66, 1
store i32 %67, i32* %3
br label %35
68: ; preds = %43
ret void
}

LLVM IR (-O2):
define void @tourner() {
%1 = tail call i32 @switchCoord(i32 4, i32 13)
%2 = tail call i32 @switchCoord(i32 4, i32 14)
%3 = tail call i32 @switchCoord(i32 4, i32 15)
%4 = tail call i32 @switchCoord(i32 4, i32 16)
%5 = tail call i32 @switchCoord(i32 5, i32 13)
%6 = tail call i32 @switchCoord(i32 5, i32 14)
%7 = tail call i32 @switchCoord(i32 5, i32 15)
%8 = tail call i32 @switchCoord(i32 5, i32 16)
%9 = tail call i32 @switchCoord(i32 6, i32 13)
%10 = tail call i32 @switchCoord(i32 6, i32 14)
%11 = tail call i32 @switchCoord(i32 6, i32 15)
%12 = tail call i32 @switchCoord(i32 6, i32 16)
%13 = tail call i32 @switchCoord(i32 7, i32 13)
%14 = tail call i32 @switchCoord(i32 7, i32 14)
%15 = tail call i32 @switchCoord(i32 7, i32 15)
%16 = tail call i32 @switchCoord(i32 7, i32 16)
%17 = tail call i32 @switchCoord(i32 8, i32 13)
%18 = tail call i32 @switchCoord(i32 8, i32 14)
%19 = tail call i32 @switchCoord(i32 8, i32 15)
%20 = tail call i32 @switchCoord(i32 8, i32 16)
%21 = tail call i32 @switchCoord(i32 9, i32 13)
%22 = tail call i32 @switchCoord(i32 9, i32 14)
%23 = tail call i32 @switchCoord(i32 9, i32 15)
%24 = tail call i32 @switchCoord(i32 9, i32 16)
%25 = tail call i32 @switchCoord(i32 10, i32 13)
%26 = tail call i32 @switchCoord(i32 10, i32 14)
%27 = tail call i32 @switchCoord(i32 10, i32 15)
%28 = tail call i32 @switchCoord(i32 10, i32 16)
%29 = tail call i32 @switchCoord(i32 11, i32 13)
%30 = tail call i32 @switchCoord(i32 11, i32 14)
%31 = tail call i32 @switchCoord(i32 11, i32 15)
%32 = tail call i32 @switchCoord(i32 11, i32 16)
%33 = tail call i32 @switchCoord(i32 12, i32 13)
%34 = tail call i32 @switchCoord(i32 12, i32 14)
%35 = tail call i32 @switchCoord(i32 12, i32 15)
%36 = tail call i32 @switchCoord(i32 12, i32 16)
br label %37
37: ; preds = %0, %49
%38 = phi i32 [ 13, %0 ], [ %56, %49 ]
%39 = phi i32 [ 12, %0 ], [ %51, %49 ]
%40 = phi i32 [ 1, %0 ], [ %52, %49 ]
%41 = add nuw nsw i32 %40, 4
%42 = sub nsw i32 13, %40
%43 = icmp sgt i32 %41, %42
br i1 %43, label %49, label %44
44: ; preds = %37, %44
%45 = phi i32 [ %47, %44 ], [ %41, %37 ]
%46 = tail call i32 @switchCoord(i32 %45, i32 %39)
%47 = add i32 %45, 1
%48 = icmp eq i32 %47, %38
br i1 %48, label %49, label %44
49: ; preds = %44, %37
%50 = phi i32 [ %41, %37 ], [ %38, %44 ]
%51 = add nsw i32 %39, -1
%52 = add nuw nsw i32 %40, 1
%53 = icmp sgt i32 %39, 9
%54 = icmp slt i32 %50, 9
%55 = select i1 %53, i1 true, i1 %54
%56 = add nsw i32 %38, -1
br i1 %55, label %37, label %57
57: ; preds = %49
ret void
}