#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 */
scalar_t__ VerifierNombre(char *, int *);
scalar_t__ VerifierOperateur(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
char LireNombreOperateur(int *nb) {
  char ch[10];
  char Type;
  printf("donner un numbre ou un operateur: ");
  scanf("%s", ch);
  if (VerifierOperateur(ch))
    return ch[0];
  else if (VerifierNombre(ch, nb))
    return 'N';
  else
    return '.';
}


x86 assembly (clang, -O0):
<LireNombreOperateur>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
lea    -0x1a(%rbp),%rsi
lea    0xec0(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x1a(%rbp),%rdi
call   1050 <VerifierOperateur@plt>
cmp    $0x0,%rax
je     1186 <LireNombreOperateur+0x46>
mov    -0x1a(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    11aa <LireNombreOperateur+0x6a>
lea    -0x1a(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <VerifierNombre@plt>
cmp    $0x0,%rax
je     11a6 <LireNombreOperateur+0x66>
movb   $0x4e,-0x1(%rbp)
jmp    11aa <LireNombreOperateur+0x6a>
movb   $0x2e,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LireNombreOperateur>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%r14
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
lea    0xec6(%rip),%rdi
lea    0xe(%rsp),%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1050 <VerifierOperateur@plt>
test   %rax,%rax
je     117d <LireNombreOperateur+0x3d>
mov    0xe(%rsp),%al
jmp    1195 <LireNombreOperateur+0x55>
lea    0xe(%rsp),%rdi
mov    %r14,%rsi
call   1030 <VerifierNombre@plt>
test   %rax,%rax
setne  %al
shl    $0x5,%al
add    $0x2e,%al
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [35 x i8] c"donner un numbre ou un operateur: \00"
@.str.1 = [3 x i8] c"%s\00"
define signext i8 @LireNombreOperateur(i32* %0) {
%2 = alloca i8
%3 = alloca i32*
%4 = alloca [10 x i8]
%5 = alloca i8
store i32* %0, i32** %3
%6 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%10 = call i64 @VerifierOperateur(i8* %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%14 = load i8, i8* %13
store i8 %14, i8* %2
br label %22
15: ; preds = %1
%16 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%17 = load i32*, i32** %3
%18 = call i64 @VerifierNombre(i8* %16, i32* %17)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %15
store i8 78, i8* %2
br label %22
21: ; preds = %15
store i8 46, i8* %2
br label %22
22: ; preds = %21, %20, %12
%23 = load i8, i8* %2
ret i8 %23
}

LLVM IR (-O2):
@.str = [35 x i8] c"donner un numbre ou un operateur: \00"
@.str.1 = [3 x i8] c"%s\00"
define signext i8 @LireNombreOperateur(i32* %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%6 = call i64 @VerifierOperateur(i8* %3)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = load i8, i8* %3
br label %14
10: ; preds = %1
%11 = call i64 @VerifierNombre(i8* %3, i32* %0)
%12 = icmp eq i64 %11, 0
%13 = select i1 %12, i8 46, i8 78
br label %14
14: ; preds = %10, %8
%15 = phi i8 [ %9, %8 ], [ %13, %10 ]
ret i8 %15
}