#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*/ fgets(char *, int, int /*<<< orphan*/);
scalar_t__ isspace(char);
int /*<<< orphan*/ sscanf(char *, char *, long *);
int /*<<< orphan*/ stdin;
void lectureLigneParametres(long resultat[]) {
  char ligne[512], *ptr;
  ptr = ligne;
  fgets(ligne, 512, stdin);
  int index = 0;
  while (*ptr != '\0') {
    sscanf(ptr, "%ld", &resultat[index]);
    while (!isspace(*ptr)) {
      ptr++;
    }
    while (isspace(*ptr)) {
      ptr++;
    }
    index++;
  }
}


x86 assembly (clang, -O0):
<lectureLigneParametres>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x210(%rbp),%rax
mov    %rax,-0x218(%rbp)
lea    -0x210(%rbp),%rdi
mov    0x2e8d(%rip),%rax
mov    (%rax),%edx
mov    $0x200,%esi
call   1040 <fgets@plt>
movl   $0x0,-0x21c(%rbp)
mov    -0x218(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     122e <lectureLigneParametres+0xfe>
mov    -0x218(%rbp),%rdi
mov    -0x8(%rbp),%rdx
movslq -0x21c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdx
lea    0xe5c(%rip),%rsi
call   1050 <sscanf@plt>
mov    -0x218(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11ce <lectureLigneParametres+0x9e>
jmp    11e5 <lectureLigneParametres+0xb5>
mov    -0x218(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x218(%rbp)
jmp    11a9 <lectureLigneParametres+0x79>
jmp    11ea <lectureLigneParametres+0xba>
mov    -0x218(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     121a <lectureLigneParametres+0xea>
mov    -0x218(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x218(%rbp)
jmp    11ea <lectureLigneParametres+0xba>
mov    -0x21c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x21c(%rbp)
jmp    1171 <lectureLigneParametres+0x41>
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lectureLigneParametres>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x200,%rsp
mov    %rdi,%r14
mov    0x2e9e(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x200,%esi
call   1040 <fgets@plt>
cmpb   $0x0,(%rsp)
je     11cb <lectureLigneParametres+0x9b>
xor    %r12d,%r12d
lea    0xe94(%rip),%r15
nopl   0x0(%rax)
lea    (%r14,%r12,8),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <sscanf@plt>
add    $0xffffffffffffffff,%rbx
mov    %rbx,%r13
cs nopw 0x0(%rax,%rax,1)
mov    %r13,%rbx
add    $0x1,%r13
movsbl 0x1(%rbx),%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1190 <lectureLigneParametres+0x60>
cs nopw 0x0(%rax,%rax,1)
nop
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    11b0 <lectureLigneParametres+0x80>
add    $0x1,%r12
cmpb   $0x0,(%rbx)
jne    1170 <lectureLigneParametres+0x40>
add    $0x200,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [4 x i8] c"%ld\00"
define void @lectureLigneParametres(i64* %0) {
%2 = alloca i64*
%3 = alloca [512 x i8]
%4 = alloca i8*
%5 = alloca i32
store i64* %0, i64** %2
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
store i8* %6, i8** %4
%7 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%8 = load i32, i32* @stdin
%9 = call i32 @fgets(i8* %7, i32 512, i32 %8)
store i32 0, i32* %5
br label %10
10: ; preds = %40, %1
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %43
15: ; preds = %10
%16 = load i8*, i8** %4
%17 = load i64*, i64** %2
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i64, i64* %17, i64 %19
%21 = call i32 @sscanf(i8* %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %20)
br label %22
22: ; preds = %28, %15
%23 = load i8*, i8** %4
%24 = load i8, i8* %23
%25 = call i64 @isspace(i8 signext %24)
%26 = icmp ne i64 %25, 0
%27 = xor i1 %26, true
br i1 %27, label %28, label %31
28: ; preds = %22
%29 = load i8*, i8** %4
%30 = getelementptr inbounds i8, i8* %29, i32 1
store i8* %30, i8** %4
br label %22
31: ; preds = %22
br label %32
32: ; preds = %37, %31
%33 = load i8*, i8** %4
%34 = load i8, i8* %33
%35 = call i64 @isspace(i8 signext %34)
%36 = icmp ne i64 %35, 0
br i1 %36, label %37, label %40
37: ; preds = %32
%38 = load i8*, i8** %4
%39 = getelementptr inbounds i8, i8* %38, i32 1
store i8* %39, i8** %4
br label %32
40: ; preds = %32
%41 = load i32, i32* %5
%42 = add nsw i32 %41, 1
store i32 %42, i32* %5
br label %10
43: ; preds = %10
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [4 x i8] c"%ld\00"
define void @lectureLigneParametres(i64* %0) {
%2 = alloca [512 x i8]
%3 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 512, i32 %4)
%6 = load i8, i8* %3
%7 = icmp eq i8 %6, 0
br i1 %7, label %29, label %8
8: ; preds = %1, %25
%9 = phi i64 [ %26, %25 ], [ 0, %1 ]
%10 = phi i8* [ %20, %25 ], [ %3, %1 ]
%11 = getelementptr inbounds i64, i64* %0, i64 %9
%12 = call i32 @sscanf(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %11)
br label %13
13: ; preds = %13, %8
%14 = phi i8* [ %10, %8 ], [ %18, %13 ]
%15 = load i8, i8* %14
%16 = call i64 @isspace(i8 signext %15)
%17 = icmp eq i64 %16, 0
%18 = getelementptr inbounds i8, i8* %14, i64 1
br i1 %17, label %13, label %19
19: ; preds = %13, %19
%20 = phi i8* [ %24, %19 ], [ %14, %13 ]
%21 = load i8, i8* %20
%22 = call i64 @isspace(i8 signext %21)
%23 = icmp eq i64 %22, 0
%24 = getelementptr inbounds i8, i8* %20, i64 1
br i1 %23, label %25, label %19
25: ; preds = %19
%26 = add nuw i64 %9, 1
%27 = load i8, i8* %20
%28 = icmp eq i8 %27, 0
br i1 %28, label %29, label %8
29: ; preds = %25, %1
ret void
}