#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 */
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ parse_line(char *);
int /*<<< orphan*/ print_loop(char, int);
int /*<<< orphan*/ printf(char *);
char *strchr(char *, char);
int strlen(char *);
int extract_data(char *data) {
  FILE *fp;
  char *line, *next = data;
  size_t len = 0;
  ssize_t read;
  int number = 1;
  int parse = 0;
  print_loop(' ', 2);
  printf("Libellé");
  print_loop(' ', 30 - strlen("Libellé"));
  print_loop(' ', 5);
  printf("Der");
  print_loop(' ', 10 - strlen("Der"));
  printf("Var");
  print_loop(' ', 10 - strlen("Var"));
  printf("Ouv");
  print_loop(' ', 10 - strlen("Ouv"));
  printf("max");
  print_loop(' ', 10 - strlen("max"));
  printf("min");
  print_loop(' ', 10 - strlen("min"));
  printf("1janv");
  print_loop(' ', 10 - strlen("1janv"));
  printf("Vol");
  print_loop(' ', 10 - strlen("Vol"));
  printf("\n");
  while (1) {
    line = next;
    next = strchr(line, '\n');
    if (next) {
      *next = 0;
      next++;
      parse_line(line);
    } else
      break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<extract_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movl   $0x1,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    $0x20,%edi
mov    $0x2,%esi
call   1030 <print_loop@plt>
lea    0xe70(%rip),%rdi
call   1060 <printf@plt>
lea    0xe64(%rip),%rdi
call   1040 <strlen@plt>
mov    $0x1e,%esi
sub    %eax,%esi
mov    $0x20,%edi
call   1030 <print_loop@plt>
mov    $0x20,%edi
mov    $0x5,%esi
call   1030 <print_loop@plt>
lea    0xe41(%rip),%rdi
call   1060 <printf@plt>
lea    0xe35(%rip),%rdi
call   1040 <strlen@plt>
mov    $0xa,%esi
sub    %eax,%esi
mov    $0x20,%edi
call   1030 <print_loop@plt>
lea    0xe1c(%rip),%rdi
call   1060 <printf@plt>
lea    0xe10(%rip),%rdi
call   1040 <strlen@plt>
mov    $0xa,%esi
sub    %eax,%esi
mov    $0x20,%edi
call   1030 <print_loop@plt>
lea    0xdf7(%rip),%rdi
call   1060 <printf@plt>
lea    0xdeb(%rip),%rdi
call   1040 <strlen@plt>
mov    $0xa,%esi
sub    %eax,%esi
mov    $0x20,%edi
call   1030 <print_loop@plt>
lea    0xdd2(%rip),%rdi
call   1060 <printf@plt>
lea    0xdc6(%rip),%rdi
call   1040 <strlen@plt>
mov    $0xa,%esi
sub    %eax,%esi
mov    $0x20,%edi
call   1030 <print_loop@plt>
lea    0xdad(%rip),%rdi
call   1060 <printf@plt>
lea    0xda1(%rip),%rdi
call   1040 <strlen@plt>
mov    $0xa,%esi
sub    %eax,%esi
mov    $0x20,%edi
call   1030 <print_loop@plt>
lea    0xd88(%rip),%rdi
call   1060 <printf@plt>
lea    0xd7c(%rip),%rdi
call   1040 <strlen@plt>
mov    $0xa,%esi
sub    %eax,%esi
mov    $0x20,%edi
call   1030 <print_loop@plt>
lea    0xd65(%rip),%rdi
call   1060 <printf@plt>
lea    0xd59(%rip),%rdi
call   1040 <strlen@plt>
mov    $0xa,%esi
sub    %eax,%esi
mov    $0x20,%edi
call   1030 <print_loop@plt>
lea    0xd40(%rip),%rdi
call   1060 <printf@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0xa,%esi
call   1050 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1332 <extract_data+0x1e2>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1070 <parse_line@plt>
jmp    1337 <extract_data+0x1e7>
jmp    133c <extract_data+0x1ec>
jmp    12ec <extract_data+0x19c>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_data>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbp
mov    $0x20,%edi
mov    $0x2,%esi
call   1040 <print_loop@plt>
lea    0xe83(%rip),%rbx
mov    %rbx,%rdi
call   1070 <printf@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    $0x1e,%esi
sub    %eax,%esi
mov    $0x20,%edi
call   1040 <print_loop@plt>
mov    $0x20,%edi
mov    $0x5,%esi
call   1040 <print_loop@plt>
lea    0xe55(%rip),%rbx
mov    %rbx,%rdi
call   1070 <printf@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    $0xa,%r14d
mov    $0xa,%esi
sub    %eax,%esi
mov    $0x20,%edi
call   1040 <print_loop@plt>
lea    0xe2b(%rip),%rbx
mov    %rbx,%rdi
call   1070 <printf@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    $0xa,%esi
sub    %eax,%esi
mov    $0x20,%edi
call   1040 <print_loop@plt>
lea    0xe07(%rip),%rbx
mov    %rbx,%rdi
call   1070 <printf@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    $0xa,%esi
sub    %eax,%esi
mov    $0x20,%edi
call   1040 <print_loop@plt>
lea    0xde3(%rip),%rbx
mov    %rbx,%rdi
call   1070 <printf@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    $0xa,%esi
sub    %eax,%esi
mov    $0x20,%edi
call   1040 <print_loop@plt>
lea    0xdbf(%rip),%rbx
mov    %rbx,%rdi
call   1070 <printf@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    $0xa,%esi
sub    %eax,%esi
mov    $0x20,%edi
call   1040 <print_loop@plt>
lea    0xd9b(%rip),%rbx
mov    %rbx,%rdi
call   1070 <printf@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    $0xa,%esi
sub    %eax,%esi
mov    $0x20,%edi
call   1040 <print_loop@plt>
lea    0xd79(%rip),%rbx
mov    %rbx,%rdi
call   1070 <printf@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
sub    %eax,%r14d
mov    $0x20,%edi
mov    %r14d,%esi
call   1040 <print_loop@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbp,%rdi
mov    $0xa,%esi
call   1060 <strchr@plt>
test   %rax,%rax
je     1317 <extract_data+0x1b7>
cs nopw 0x0(%rax,%rax,1)
movb   $0x0,(%rax)
mov    %rax,%rbx
add    $0x1,%rbx
mov    %rbp,%rdi
call   1080 <parse_line@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1060 <strchr@plt>
mov    %rbx,%rbp
test   %rax,%rax
jne    12f0 <extract_data+0x190>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Libell\C3\A9\00"
@.str.1 = [4 x i8] c"Der\00"
@.str.2 = [4 x i8] c"Var\00"
@.str.3 = [4 x i8] c"Ouv\00"
@.str.4 = [4 x i8] c"max\00"
@.str.5 = [4 x i8] c"min\00"
@.str.6 = [6 x i8] c"1janv\00"
@.str.7 = [4 x i8] c"Vol\00"
@.str.8 = [2 x i8] c"\0A\00"
define i32 @extract_data(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %2
%10 = load i8*, i8** %2
store i8* %10, i8** %5
store i64 0, i64* %6
store i32 1, i32* %8
store i32 0, i32* %9
%11 = call i32 @print_loop(i8 signext 32, i32 2)
%12 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @strlen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%14 = sub nsw i32 30, %13
%15 = call i32 @print_loop(i8 signext 32, i32 %14)
%16 = call i32 @print_loop(i8 signext 32, i32 5)
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%18 = call i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%19 = sub nsw i32 10, %18
%20 = call i32 @print_loop(i8 signext 32, i32 %19)
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%22 = call i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%23 = sub nsw i32 10, %22
%24 = call i32 @print_loop(i8 signext 32, i32 %23)
%25 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%26 = call i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%27 = sub nsw i32 10, %26
%28 = call i32 @print_loop(i8 signext 32, i32 %27)
%29 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%30 = call i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%31 = sub nsw i32 10, %30
%32 = call i32 @print_loop(i8 signext 32, i32 %31)
%33 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%34 = call i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%35 = sub nsw i32 10, %34
%36 = call i32 @print_loop(i8 signext 32, i32 %35)
%37 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%38 = call i32 @strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%39 = sub nsw i32 10, %38
%40 = call i32 @print_loop(i8 signext 32, i32 %39)
%41 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%42 = call i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%43 = sub nsw i32 10, %42
%44 = call i32 @print_loop(i8 signext 32, i32 %43)
%45 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %46
46: ; preds = %1, %59
%47 = load i8*, i8** %5
store i8* %47, i8** %4
%48 = load i8*, i8** %4
%49 = call i8* @strchr(i8* %48, i8 signext 10)
store i8* %49, i8** %5
%50 = load i8*, i8** %5
%51 = icmp ne i8* %50, null
br i1 %51, label %52, label %58
52: ; preds = %46
%53 = load i8*, i8** %5
store i8 0, i8* %53
%54 = load i8*, i8** %5
%55 = getelementptr inbounds i8, i8* %54, i32 1
store i8* %55, i8** %5
%56 = load i8*, i8** %4
%57 = call i32 @parse_line(i8* %56)
br label %59
58: ; preds = %46
br label %60
59: ; preds = %52
br label %46
60: ; preds = %58
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"Libell\C3\A9\00"
@.str.1 = [4 x i8] c"Der\00"
@.str.2 = [4 x i8] c"Var\00"
@.str.3 = [4 x i8] c"Ouv\00"
@.str.4 = [4 x i8] c"max\00"
@.str.5 = [4 x i8] c"min\00"
@.str.6 = [6 x i8] c"1janv\00"
@.str.7 = [4 x i8] c"Vol\00"
define i32 @extract_data(i8* %0) {
%2 = tail call i32 @print_loop(i8 signext 32, i32 2)
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @strlen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = sub nsw i32 30, %4
%6 = tail call i32 @print_loop(i8 signext 32, i32 %5)
%7 = tail call i32 @print_loop(i8 signext 32, i32 5)
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%10 = sub nsw i32 10, %9
%11 = tail call i32 @print_loop(i8 signext 32, i32 %10)
%12 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%13 = tail call i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%14 = sub nsw i32 10, %13
%15 = tail call i32 @print_loop(i8 signext 32, i32 %14)
%16 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%17 = tail call i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%18 = sub nsw i32 10, %17
%19 = tail call i32 @print_loop(i8 signext 32, i32 %18)
%20 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%21 = tail call i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%22 = sub nsw i32 10, %21
%23 = tail call i32 @print_loop(i8 signext 32, i32 %22)
%24 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%25 = tail call i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%26 = sub nsw i32 10, %25
%27 = tail call i32 @print_loop(i8 signext 32, i32 %26)
%28 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%29 = tail call i32 @strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%30 = sub nsw i32 10, %29
%31 = tail call i32 @print_loop(i8 signext 32, i32 %30)
%32 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%33 = tail call i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%34 = sub nsw i32 10, %33
%35 = tail call i32 @print_loop(i8 signext 32, i32 %34)
%36 = tail call i32 @putchar(i32 10)
%37 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 10)
%38 = icmp eq i8* %37, null
br i1 %38, label %46, label %39
39: ; preds = %1, %39
%40 = phi i8* [ %44, %39 ], [ %37, %1 ]
%41 = phi i8* [ %42, %39 ], [ %0, %1 ]
store i8 0, i8* %40
%42 = getelementptr inbounds i8, i8* %40, i64 1
%43 = tail call i32 @parse_line(i8* %41)
%44 = tail call i8* @strchr(i8* dereferenceable(1) %42, i8 signext 10)
%45 = icmp eq i8* %44, null
br i1 %45, label %46, label %39
46: ; preds = %39, %1
ret i32 0
}