#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*/ FILE;

/* Variables and functions */
int EOF;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int fscanf(int /*<<< orphan*/ *, char *, double *, double *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  FILE *f_in;
  int nbno = 0;
  int state = 0;
  if (argc < 2) {
    fprintf(stderr, "%s [fichier noeuds]\n", argv[0]);
    exit(1);
  }
  fprintf(stderr, "opening file %s...", argv[1]);
  fflush(stdin);
  f_in = fopen(argv[1], "r+t");
  if (!f_in) {
    fprintf(stderr, "error!\n");
    exit(1);
  }
  fprintf(stdout, "%% Imported by xls2funct - RoBo - 2003;\n\n");
  fprintf(stdout, "Funct myf;\n\n");
  do {
    double x, y;
    state = fscanf(f_in, "%Lf,%Lf\n", &x, &y);
    if (state != EOF) {
      fprintf(stdout, "myf.setdata(%20.15E, %20.15E);\n", y, x);
    }
  } while (state != EOF);
  fprintf(stdout, "\n%% EOF");
  fprintf(stderr, "done.\n");
  fclose(f_in);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11b6 <main+0x56>
mov    0x2e3b(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe5b(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    0x2e13(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe47(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2e0c(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe36(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1227 <main+0xc7>
mov    0x2dc3(%rip),%rax
mov    (%rax),%edi
lea    0xe16(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    0x2d9a(%rip),%rax
mov    (%rax),%edi
lea    0xdfd(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2d83(%rip),%rax
mov    (%rax),%edi
lea    0xe10(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe0b(%rip),%rsi
lea    -0x28(%rbp),%rdx
lea    -0x30(%rbp),%rcx
call   1040 <fscanf@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    0x2d66(%rip),%rcx
cmp    (%rcx),%eax
je     12a3 <main+0x143>
mov    0x2d3f(%rip),%rax
mov    (%rax),%edi
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
lea    0xdd8(%rip),%rsi
mov    $0x2,%al
call   1050 <fprintf@plt>
jmp    12a8 <main+0x148>
mov    -0x20(%rbp),%eax
mov    0x2d2e(%rip),%rcx
cmp    (%rcx),%eax
jne    1255 <main+0xf5>
mov    0x2d07(%rip),%rax
mov    (%rax),%edi
lea    0xdca(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2cf8(%rip),%rax
mov    (%rax),%edi
lea    0xdbb(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %edi,%eax
mov    0x2e56(%rip),%rcx
mov    (%rcx),%edi
cmp    $0x1,%eax
jle    1297 <main+0x137>
mov    0x8(%rbx),%rdx
lea    0xe85(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x2e4a(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    0x8(%rbx),%rdi
lea    0xe78(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     12b2 <main+0x152>
mov    %rax,%rbx
mov    0x2e00(%rip),%rbp
mov    0x0(%rbp),%edi
lea    0xe62(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0xe7b(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0x10(%rsp),%r15
lea    0x8(%rsp),%r12
mov    0x2de5(%rip),%r14
lea    0xe72(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
lea    0xe51(%rip),%rsi
mov    %r15,%rdx
mov    %r12,%rcx
call   1040 <fscanf@plt>
cmp    (%r14),%eax
je     1250 <main+0xf0>
mov    %eax,%ebp
mov    0x2d95(%rip),%rax
mov    (%rax),%edi
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mov    %r13,%rsi
mov    $0x2,%al
call   1050 <fprintf@plt>
cmp    (%r14),%ebp
jne    1210 <main+0xb0>
mov    0x2d71(%rip),%rax
mov    (%rax),%edi
lea    0xe34(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x2d62(%rip),%rax
mov    (%rax),%edi
lea    0xe25(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    (%rbx),%rdx
lea    0xd5f(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    0x2d17(%rip),%rax
mov    (%rax),%edi
lea    0xd6a(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"%s [fichier noeuds]\0A\00"
@.str.1 = [19 x i8] c"opening file %s...\00"
@stdin = global i32 0
@.str.2 = [4 x i8] c"r+t\00"
@.str.3 = [8 x i8] c"error!\0A\00"
@stdout = global i32 0
@.str.4 = [42 x i8] c"%% Imported by xls2funct - RoBo - 2003;\0A\0A\00"
@.str.5 = [13 x i8] c"Funct myf;\0A\0A\00"
@.str.6 = [9 x i8] c"%Lf,%Lf\0A\00"
@EOF = global i32 0
@.str.7 = [32 x i8] c"myf.setdata(%20.15E, %20.15E);\0A\00"
@.str.8 = [8 x i8] c"\0A%% EOF\00"
@.str.9 = [7 x i8] c"done.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
%10 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
store i32 0, i32* %8
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 2
br i1 %12, label %13, label %20
13: ; preds = %2
%14 = load i32, i32* @stderr
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 0
%17 = load i8*, i8** %16
%18 = call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %17)
%19 = call i32 @exit(i32 1)
unreachable
20: ; preds = %2
%21 = load i32, i32* @stderr
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %24)
%26 = load i32, i32* @stdin
%27 = call i32 @fflush(i32 %26)
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = call i32* @fopen(i8* %30, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
store i32* %31, i32** %6
%32 = load i32*, i32** %6
%33 = icmp ne i32* %32, null
br i1 %33, label %38, label %34
34: ; preds = %20
%35 = load i32, i32* @stderr
%36 = call i32 (i32, i8*, ...) @fprintf(i32 %35, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%37 = call i32 @exit(i32 1)
unreachable
38: ; preds = %20
%39 = load i32, i32* @stdout
%40 = call i32 (i32, i8*, ...) @fprintf(i32 %39, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0))
%41 = load i32, i32* @stdout
%42 = call i32 (i32, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
br label %43
43: ; preds = %55, %38
%44 = load i32*, i32** %6
%45 = call i32 @fscanf(i32* %44, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), double* %9, double* %10)
store i32 %45, i32* %8
%46 = load i32, i32* %8
%47 = load i32, i32* @EOF
%48 = icmp ne i32 %46, %47
br i1 %48, label %49, label %54
49: ; preds = %43
%50 = load i32, i32* @stdout
%51 = load double, double* %10
%52 = load double, double* %9
%53 = call i32 (i32, i8*, ...) @fprintf(i32 %50, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0), double %51, double %52)
br label %54
54: ; preds = %49, %43
br label %55
55: ; preds = %54
%56 = load i32, i32* %8
%57 = load i32, i32* @EOF
%58 = icmp ne i32 %56, %57
br i1 %58, label %43, label %59
59: ; preds = %55
%60 = load i32, i32* @stdout
%61 = call i32 (i32, i8*, ...) @fprintf(i32 %60, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%62 = load i32, i32* @stderr
%63 = call i32 (i32, i8*, ...) @fprintf(i32 %62, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%64 = load i32*, i32** %6
%65 = call i32 @fclose(i32* %64)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"%s [fichier noeuds]\0A\00"
@.str.1 = [19 x i8] c"opening file %s...\00"
@stdin = global i32 0
@.str.2 = [4 x i8] c"r+t\00"
@.str.3 = [8 x i8] c"error!\0A\00"
@stdout = global i32 0
@.str.4 = [42 x i8] c"%% Imported by xls2funct - RoBo - 2003;\0A\0A\00"
@.str.5 = [13 x i8] c"Funct myf;\0A\0A\00"
@.str.6 = [9 x i8] c"%Lf,%Lf\0A\00"
@EOF = global i32 0
@.str.7 = [32 x i8] c"myf.setdata(%20.15E, %20.15E);\0A\00"
@.str.8 = [8 x i8] c"\0A%% EOF\00"
@.str.9 = [7 x i8] c"done.\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca double
%4 = alloca double
%5 = icmp slt i32 %0, 2
%6 = load i32, i32* @stderr
br i1 %5, label %7, label %11
7: ; preds = %2
%8 = load i8*, i8** %1
%9 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %2
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%15 = load i32, i32* @stdin
%16 = tail call i32 @fflush(i32 %15)
%17 = load i8*, i8** %12
%18 = tail call i32* @fopen(i8* %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%19 = icmp eq i32* %18, null
br i1 %19, label %20, label %24
20: ; preds = %11
%21 = load i32, i32* @stderr
%22 = tail call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%23 = tail call i32 @exit(i32 1)
unreachable
24: ; preds = %11
%25 = load i32, i32* @stdout
%26 = tail call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0))
%27 = load i32, i32* @stdout
%28 = tail call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%29 = bitcast double* %3 to i8*
%30 = bitcast double* %4 to i8*
br label %31
31: ; preds = %36, %24
%32 = call i32 @fscanf(i32* %18, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), double* %3, double* %4)
%33 = load i32, i32* @EOF
%34 = icmp eq i32 %32, %33
br i1 %34, label %35, label %36
35: ; preds = %31
br label %43
36: ; preds = %31
%37 = load i32, i32* @stdout
%38 = load double, double* %4
%39 = load double, double* %3
%40 = call i32 (i32, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0), double %38, double %39)
%41 = load i32, i32* @EOF
%42 = icmp eq i32 %32, %41
br i1 %42, label %43, label %31
43: ; preds = %36, %35
%44 = load i32, i32* @stdout
%45 = call i32 (i32, i8*, ...) @fprintf(i32 %44, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%46 = load i32, i32* @stderr
%47 = call i32 (i32, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%48 = call i32 @fclose(i32* %18)
ret i32 0
}