#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*/ sscanf(char *, char *, char *, int *);
int estValideCoupHumainBatailleNavale(char emplacement[500]) {
  int ligne;
  char colonne;
  sscanf(emplacement, "%c%d", &colonne, &ligne);
  if (colonne < 'A' || colonne > 'J')
    return 0;
  if (ligne < 1 || ligne > 10)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<estValideCoupHumainBatailleNavale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    -0x15(%rbp),%rdx
lea    -0x14(%rbp),%rcx
call   1030 <sscanf@plt>
movsbl -0x15(%rbp),%eax
cmp    $0x41,%eax
jl     114e <estValideCoupHumainBatailleNavale+0x3e>
movsbl -0x15(%rbp),%eax
cmp    $0x4a,%eax
jle    115a <estValideCoupHumainBatailleNavale+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1181 <estValideCoupHumainBatailleNavale+0x71>
cmpl   $0x1,-0x14(%rbp)
jl     116e <estValideCoupHumainBatailleNavale+0x5e>
cmpl   $0xa,-0x14(%rbp)
jle    117a <estValideCoupHumainBatailleNavale+0x6a>
movl   $0x0,-0x4(%rbp)
jmp    1181 <estValideCoupHumainBatailleNavale+0x71>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<estValideCoupHumainBatailleNavale>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x3(%rsp),%rdx
lea    0x4(%rsp),%rcx
call   1030 <sscanf@plt>
mov    0x3(%rsp),%al
add    $0xbf,%al
cmp    $0xa,%al
setb   %al
mov    0x4(%rsp),%ecx
add    $0xffffffff,%ecx
cmp    $0xa,%ecx
setb   %cl
and    %al,%cl
movzbl %cl,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%c%d\00"
define i32 @estValideCoupHumainBatailleNavale(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @sscanf(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5, i32* %4)
%8 = load i8, i8* %5
%9 = sext i8 %8 to i32
%10 = icmp slt i32 %9, 65
br i1 %10, label %15, label %11
11: ; preds = %1
%12 = load i8, i8* %5
%13 = sext i8 %12 to i32
%14 = icmp sgt i32 %13, 74
br i1 %14, label %15, label %16
15: ; preds = %11, %1
store i32 0, i32* %2
br label %24
16: ; preds = %11
%17 = load i32, i32* %4
%18 = icmp slt i32 %17, 1
br i1 %18, label %22, label %19
19: ; preds = %16
%20 = load i32, i32* %4
%21 = icmp sgt i32 %20, 10
br i1 %21, label %22, label %23
22: ; preds = %19, %16
store i32 0, i32* %2
br label %24
23: ; preds = %19
store i32 1, i32* %2
br label %24
24: ; preds = %23, %22, %15
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
@.str = [5 x i8] c"%c%d\00"
define i32 @estValideCoupHumainBatailleNavale(i8* nocapture %0) {
%2 = alloca i32
%3 = alloca i8
%4 = bitcast i32* %2 to i8*
%5 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3, i32* %2)
%6 = load i8, i8* %3
%7 = add i8 %6, -65
%8 = icmp ult i8 %7, 10
%9 = load i32, i32* %2
%10 = add i32 %9, -1
%11 = icmp ult i32 %10, 10
%12 = select i1 %8, i1 %11, i1 false
%13 = zext i1 %12 to i32
ret i32 %13
}