#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 adirisseSouris();
scalar_t__ estDansRectangle(int, int, int, int, int, int);
int hauteurFenetre();
int largeurFenetre();
int ordonneeSouris();
int detecteMenuOption(void) {
  int abs = adirisseSouris();
  int ord = ordonneeSouris();
  int L = largeurFenetre();
  int H = hauteurFenetre();
  if (estDansRectangle(abs, ord, L / 12, H * 3 / 5, L * 5 / 12, H * 7 / 10)) {
    return 1;
  }
  if (estDansRectangle(abs, ord, L / 12, H * 7 / 20, L * 5 / 12, H / 4)) {
    return 3;
  }
  if (estDansRectangle(abs, ord, L * 7 / 12, H * 3 / 5, L * 11 / 12,
                       H * 7 / 10)) {
    return 2;
  }
  if (estDansRectangle(abs, ord, L * 7 / 12, H * 7 / 20, L * 11 / 12, H / 4)) {
    return 4;
  }
  if (estDansRectangle(abs, ord, 0, 0, L / 6, H / 10)) {
    return 5;
  }
  return 0;
}


x86 assembly (clang, -O0):
<detecteMenuOption>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x0,%al
call   1060 <adirisseSouris@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <ordonneeSouris@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1070 <largeurFenetre@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <hauteurFenetre@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%eax
mov    $0xc,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
imul   $0x3,-0x14(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
imul   $0x5,-0x10(%rbp),%eax
mov    $0xc,%r8d
cltd
idiv   %r8d
mov    %eax,%r8d
imul   $0x7,-0x14(%rbp),%eax
mov    $0xa,%r9d
cltd
idiv   %r9d
mov    -0x18(%rbp),%edx
mov    %eax,%r9d
call   1040 <estDansRectangle@plt>
cmp    $0x0,%rax
je     11e2 <detecteMenuOption+0x92>
movl   $0x1,-0x4(%rbp)
jmp    1350 <detecteMenuOption+0x200>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%eax
mov    $0xc,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
imul   $0x7,-0x14(%rbp),%eax
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
imul   $0x5,-0x10(%rbp),%eax
mov    $0xc,%r8d
cltd
idiv   %r8d
mov    %eax,%r8d
mov    -0x14(%rbp),%eax
mov    $0x4,%r9d
cltd
idiv   %r9d
mov    -0x1c(%rbp),%edx
mov    %eax,%r9d
call   1040 <estDansRectangle@plt>
cmp    $0x0,%rax
je     1243 <detecteMenuOption+0xf3>
movl   $0x3,-0x4(%rbp)
jmp    1350 <detecteMenuOption+0x200>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
imul   $0x7,-0x10(%rbp),%eax
mov    $0xc,%ecx
cltd
idiv   %ecx
mov    %eax,-0x20(%rbp)
imul   $0x3,-0x14(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
imul   $0xb,-0x10(%rbp),%eax
mov    $0xc,%r8d
cltd
idiv   %r8d
mov    %eax,%r8d
imul   $0x7,-0x14(%rbp),%eax
mov    $0xa,%r9d
cltd
idiv   %r9d
mov    -0x20(%rbp),%edx
mov    %eax,%r9d
call   1040 <estDansRectangle@plt>
cmp    $0x0,%rax
je     12a6 <detecteMenuOption+0x156>
movl   $0x2,-0x4(%rbp)
jmp    1350 <detecteMenuOption+0x200>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
imul   $0x7,-0x10(%rbp),%eax
mov    $0xc,%ecx
cltd
idiv   %ecx
mov    %eax,-0x24(%rbp)
imul   $0x7,-0x14(%rbp),%eax
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
imul   $0xb,-0x10(%rbp),%eax
mov    $0xc,%r8d
cltd
idiv   %r8d
mov    %eax,%r8d
mov    -0x14(%rbp),%eax
mov    $0x4,%r9d
cltd
idiv   %r9d
mov    -0x24(%rbp),%edx
mov    %eax,%r9d
call   1040 <estDansRectangle@plt>
cmp    $0x0,%rax
je     1308 <detecteMenuOption+0x1b8>
movl   $0x4,-0x4(%rbp)
jmp    1350 <detecteMenuOption+0x200>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %eax,%r8d
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%r9d
xor    %ecx,%ecx
mov    %ecx,%edx
call   1040 <estDansRectangle@plt>
cmp    $0x0,%rax
je     1349 <detecteMenuOption+0x1f9>
movl   $0x5,-0x4(%rbp)
jmp    1350 <detecteMenuOption+0x200>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<detecteMenuOption>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
xor    %eax,%eax
call   1060 <adirisseSouris@plt>
mov    %eax,0x4(%rsp)
xor    %eax,%eax
call   1050 <ordonneeSouris@plt>
mov    %eax,(%rsp)
xor    %eax,%eax
call   1070 <largeurFenetre@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <hauteurFenetre@plt>
mov    %rbx,0x20(%rsp)
movslq %ebx,%rdx
imul   $0x2aaaaaab,%rdx,%r12
mov    %r12,%rcx
shr    $0x3f,%rcx
mov    %r12,0x18(%rsp)
sar    $0x21,%r12
mov    %rcx,0x10(%rsp)
add    %ecx,%r12d
lea    (%rax,%rax,2),%ecx
movslq %ecx,%rcx
imul   $0x66666667,%rcx,%rbx
mov    %rbx,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rbx
add    %ecx,%ebx
lea    (%rdx,%rdx,4),%ecx
movslq %ecx,%rcx
imul   $0x2aaaaaab,%rcx,%r13
mov    %r13,%rcx
shr    $0x3f,%rcx
sar    $0x21,%r13
add    %ecx,%r13d
lea    0x0(,%rax,8),%ecx
mov    %rax,0x8(%rsp)
sub    %eax,%ecx
movslq %ecx,%rax
imul   $0x66666667,%rax,%rbp
mov    %rbp,%r15
shr    $0x3f,%r15
mov    %rbp,%r14
sar    $0x22,%r14
add    %r15d,%r14d
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
mov    %r12d,%edx
mov    %ebx,%ecx
mov    %r13d,%r8d
mov    %r14d,%r9d
call   1040 <estDansRectangle@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    133f <detecteMenuOption+0x1ef>
sar    $0x23,%rbp
add    %r15d,%ebp
mov    0x8(%rsp),%rax
lea    0x3(%rax),%r15d
test   %eax,%eax
cmovns %eax,%r15d
sar    $0x2,%r15d
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
mov    %r12d,%edx
mov    %ebp,%ecx
mov    %r13d,%r8d
mov    %r15d,%r9d
call   1040 <estDansRectangle@plt>
mov    %rax,%rcx
mov    $0x3,%eax
test   %rcx,%rcx
jne    133f <detecteMenuOption+0x1ef>
mov    0x20(%rsp),%rcx
lea    0x0(,%rcx,8),%eax
sub    %ecx,%eax
cltq
imul   $0x2aaaaaab,%rax,%r12
mov    %r12,%rax
shr    $0x3f,%rax
sar    $0x21,%r12
add    %eax,%r12d
lea    (%rcx,%rcx,4),%eax
lea    (%rcx,%rax,2),%eax
cltq
imul   $0x2aaaaaab,%rax,%r13
mov    %r13,%rax
shr    $0x3f,%rax
sar    $0x21,%r13
add    %eax,%r13d
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
mov    %r12d,%edx
mov    %ebx,%ecx
mov    %r13d,%r8d
mov    %r14d,%r9d
call   1040 <estDansRectangle@plt>
mov    %rax,%rcx
mov    $0x2,%eax
test   %rcx,%rcx
jne    133f <detecteMenuOption+0x1ef>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
mov    %r12d,%edx
mov    %ebp,%ecx
mov    %r13d,%r8d
mov    %r15d,%r9d
call   1040 <estDansRectangle@plt>
mov    %rax,%rcx
mov    $0x4,%eax
test   %rcx,%rcx
jne    133f <detecteMenuOption+0x1ef>
mov    0x18(%rsp),%r8
shr    $0x20,%r8
add    0x10(%rsp),%r8d
movslq 0x8(%rsp),%rax
imul   $0x66666667,%rax,%r9
mov    %r9,%rax
shr    $0x3f,%rax
sar    $0x22,%r9
add    %eax,%r9d
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <estDansRectangle@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    (%rcx,%rcx,4),%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @detecteMenuOption() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = call i32 (...) @adirisseSouris()
store i32 %6, i32* %2
%7 = call i32 (...) @ordonneeSouris()
store i32 %7, i32* %3
%8 = call i32 (...) @largeurFenetre()
store i32 %8, i32* %4
%9 = call i32 (...) @hauteurFenetre()
store i32 %9, i32* %5
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = sdiv i32 %12, 12
%14 = load i32, i32* %5
%15 = mul nsw i32 %14, 3
%16 = sdiv i32 %15, 5
%17 = load i32, i32* %4
%18 = mul nsw i32 %17, 5
%19 = sdiv i32 %18, 12
%20 = load i32, i32* %5
%21 = mul nsw i32 %20, 7
%22 = sdiv i32 %21, 10
%23 = call i64 @estDansRectangle(i32 %10, i32 %11, i32 %13, i32 %16, i32 %19, i32 %22)
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %0
store i32 1, i32* %1
br label %88
26: ; preds = %0
%27 = load i32, i32* %2
%28 = load i32, i32* %3
%29 = load i32, i32* %4
%30 = sdiv i32 %29, 12
%31 = load i32, i32* %5
%32 = mul nsw i32 %31, 7
%33 = sdiv i32 %32, 20
%34 = load i32, i32* %4
%35 = mul nsw i32 %34, 5
%36 = sdiv i32 %35, 12
%37 = load i32, i32* %5
%38 = sdiv i32 %37, 4
%39 = call i64 @estDansRectangle(i32 %27, i32 %28, i32 %30, i32 %33, i32 %36, i32 %38)
%40 = icmp ne i64 %39, 0
br i1 %40, label %41, label %42
41: ; preds = %26
store i32 3, i32* %1
br label %88
42: ; preds = %26
%43 = load i32, i32* %2
%44 = load i32, i32* %3
%45 = load i32, i32* %4
%46 = mul nsw i32 %45, 7
%47 = sdiv i32 %46, 12
%48 = load i32, i32* %5
%49 = mul nsw i32 %48, 3
%50 = sdiv i32 %49, 5
%51 = load i32, i32* %4
%52 = mul nsw i32 %51, 11
%53 = sdiv i32 %52, 12
%54 = load i32, i32* %5
%55 = mul nsw i32 %54, 7
%56 = sdiv i32 %55, 10
%57 = call i64 @estDansRectangle(i32 %43, i32 %44, i32 %47, i32 %50, i32 %53, i32 %56)
%58 = icmp ne i64 %57, 0
br i1 %58, label %59, label %60
59: ; preds = %42
store i32 2, i32* %1
br label %88
60: ; preds = %42
%61 = load i32, i32* %2
%62 = load i32, i32* %3
%63 = load i32, i32* %4
%64 = mul nsw i32 %63, 7
%65 = sdiv i32 %64, 12
%66 = load i32, i32* %5
%67 = mul nsw i32 %66, 7
%68 = sdiv i32 %67, 20
%69 = load i32, i32* %4
%70 = mul nsw i32 %69, 11
%71 = sdiv i32 %70, 12
%72 = load i32, i32* %5
%73 = sdiv i32 %72, 4
%74 = call i64 @estDansRectangle(i32 %61, i32 %62, i32 %65, i32 %68, i32 %71, i32 %73)
%75 = icmp ne i64 %74, 0
br i1 %75, label %76, label %77
76: ; preds = %60
store i32 4, i32* %1
br label %88
77: ; preds = %60
%78 = load i32, i32* %2
%79 = load i32, i32* %3
%80 = load i32, i32* %4
%81 = sdiv i32 %80, 6
%82 = load i32, i32* %5
%83 = sdiv i32 %82, 10
%84 = call i64 @estDansRectangle(i32 %78, i32 %79, i32 0, i32 0, i32 %81, i32 %83)
%85 = icmp ne i64 %84, 0
br i1 %85, label %86, label %87
86: ; preds = %77
store i32 5, i32* %1
br label %88
87: ; preds = %77
store i32 0, i32* %1
br label %88
88: ; preds = %87, %86, %76, %59, %41, %25
%89 = load i32, i32* %1
ret i32 %89
}

LLVM IR (-O2):
define i32 @detecteMenuOption() {
%1 = tail call i32 (...) @adirisseSouris()
%2 = tail call i32 (...) @ordonneeSouris()
%3 = tail call i32 (...) @largeurFenetre()
%4 = tail call i32 (...) @hauteurFenetre()
%5 = sdiv i32 %3, 12
%6 = mul nsw i32 %4, 3
%7 = sdiv i32 %6, 5
%8 = mul nsw i32 %3, 5
%9 = sdiv i32 %8, 12
%10 = mul nsw i32 %4, 7
%11 = sdiv i32 %10, 10
%12 = tail call i64 @estDansRectangle(i32 %1, i32 %2, i32 %5, i32 %7, i32 %9, i32 %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %35
14: ; preds = %0
%15 = sdiv i32 %10, 20
%16 = sdiv i32 %4, 4
%17 = tail call i64 @estDansRectangle(i32 %1, i32 %2, i32 %5, i32 %15, i32 %9, i32 %16)
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %35
19: ; preds = %14
%20 = mul nsw i32 %3, 7
%21 = sdiv i32 %20, 12
%22 = mul nsw i32 %3, 11
%23 = sdiv i32 %22, 12
%24 = tail call i64 @estDansRectangle(i32 %1, i32 %2, i32 %21, i32 %7, i32 %23, i32 %11)
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %35
26: ; preds = %19
%27 = tail call i64 @estDansRectangle(i32 %1, i32 %2, i32 %21, i32 %15, i32 %23, i32 %16)
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %35
29: ; preds = %26
%30 = sdiv i32 %3, 6
%31 = sdiv i32 %4, 10
%32 = tail call i64 @estDansRectangle(i32 %1, i32 %2, i32 0, i32 0, i32 %30, i32 %31)
%33 = icmp eq i64 %32, 0
%34 = select i1 %33, i32 0, i32 5
br label %35
35: ; preds = %29, %26, %19, %14, %0
%36 = phi i32 [ 1, %0 ], [ 3, %14 ], [ 2, %19 ], [ 4, %26 ], [ %34, %29 ]
ret i32 %36
}