#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 *, int *, 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 Abaqus2oo - RoBo - 2003;\n\n");
  fprintf(stdout, "Refer dom(domain);\n");
  fprintf(stdout, "Refer nset(dom[NODESET_PO]); nset.build_hash();\n");
  do {
    int no;
    double x, y;
    state = fscanf(f_in, "%d,%Lf,%Lf\n", &no, &x, &y);
    if (state != EOF) {
      fprintf(stdout, "nset.define(%d, %20.15E, %20.15E, 0);\n", no, x, y);
    }
  } 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    $0x40,%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    0x2d6c(%rip),%rax
mov    (%rax),%edi
lea    0xe0d(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe2c(%rip),%rsi
lea    -0x24(%rbp),%rdx
lea    -0x30(%rbp),%rcx
lea    -0x38(%rbp),%r8
call   1040 <fscanf@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    0x2d4b(%rip),%rcx
cmp    (%rcx),%eax
je     12c1 <main+0x161>
mov    0x2d24(%rip),%rax
mov    (%rax),%edi
mov    -0x24(%rbp),%edx
movsd  -0x30(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
lea    0xdf5(%rip),%rsi
mov    $0x2,%al
call   1050 <fprintf@plt>
jmp    12c6 <main+0x166>
mov    -0x20(%rbp),%eax
mov    0x2d10(%rip),%rcx
cmp    (%rcx),%eax
jne    126c <main+0x10c>
mov    0x2ce9(%rip),%rax
mov    (%rax),%edi
lea    0xdee(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2cda(%rip),%rax
mov    (%rax),%edi
lea    0xddf(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x40,%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    12b1 <main+0x151>
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     12cc <main+0x16c>
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>
mov    0x0(%rbp),%edi
lea    0xe7e(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0x10(%rsp),%r12
lea    0x8(%rsp),%r13
mov    0x2dd4(%rip),%r15
lea    0xe9c(%rip),%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
lea    0xe79(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    %r12,%rcx
mov    %r13,%r8
call   1040 <fscanf@plt>
cmp    (%r15),%eax
je     126a <main+0x10a>
mov    %eax,%r14d
mov    0x2d7f(%rip),%rax
mov    (%rax),%edi
mov    0x4(%rsp),%edx
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mov    %rbp,%rsi
mov    $0x2,%al
call   1050 <fprintf@plt>
cmp    (%r15),%r14d
jne    1220 <main+0xc0>
mov    0x2d57(%rip),%rax
mov    (%rax),%edi
lea    0xe5c(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x2d48(%rip),%rax
mov    (%rax),%edi
lea    0xe4d(%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    0xd45(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    0x2cfd(%rip),%rax
mov    (%rax),%edi
lea    0xd50(%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 Abaqus2oo - RoBo - 2003;\0A\0A\00"
@.str.5 = [20 x i8] c"Refer dom(domain);\0A\00"
@.str.6 = [49 x i8] c"Refer nset(dom[NODESET_PO]); nset.build_hash();\0A\00"
@.str.7 = [12 x i8] c"%d,%Lf,%Lf\0A\00"
@EOF = global i32 0
@.str.8 = [39 x i8] c"nset.define(%d, %20.15E, %20.15E, 0);\0A\00"
@.str.9 = [8 x i8] c"\0A%% EOF\00"
@.str.10 = [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 i32
%10 = alloca double
%11 = 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
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 2
br i1 %13, label %14, label %21
14: ; preds = %2
%15 = load i32, i32* @stderr
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
%19 = call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = call i32 @exit(i32 1)
unreachable
21: ; preds = %2
%22 = load i32, i32* @stderr
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %25)
%27 = load i32, i32* @stdin
%28 = call i32 @fflush(i32 %27)
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 1
%31 = load i8*, i8** %30
%32 = call i32* @fopen(i8* %31, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
store i32* %32, i32** %6
%33 = load i32*, i32** %6
%34 = icmp ne i32* %33, null
br i1 %34, label %39, label %35
35: ; preds = %21
%36 = load i32, i32* @stderr
%37 = call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%38 = call i32 @exit(i32 1)
unreachable
39: ; preds = %21
%40 = load i32, i32* @stdout
%41 = call i32 (i32, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0))
%42 = load i32, i32* @stdout
%43 = call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%44 = load i32, i32* @stdout
%45 = call i32 (i32, i8*, ...) @fprintf(i32 %44, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.6, i64 0, i64 0))
br label %46
46: ; preds = %59, %39
%47 = load i32*, i32** %6
%48 = call i32 @fscanf(i32* %47, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32* %9, double* %10, double* %11)
store i32 %48, i32* %8
%49 = load i32, i32* %8
%50 = load i32, i32* @EOF
%51 = icmp ne i32 %49, %50
br i1 %51, label %52, label %58
52: ; preds = %46
%53 = load i32, i32* @stdout
%54 = load i32, i32* %9
%55 = load double, double* %10
%56 = load double, double* %11
%57 = call i32 (i32, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.8, i64 0, i64 0), i32 %54, double %55, double %56)
br label %58
58: ; preds = %52, %46
br label %59
59: ; preds = %58
%60 = load i32, i32* %8
%61 = load i32, i32* @EOF
%62 = icmp ne i32 %60, %61
br i1 %62, label %46, label %63
63: ; preds = %59
%64 = load i32, i32* @stdout
%65 = call i32 (i32, i8*, ...) @fprintf(i32 %64, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
%66 = load i32, i32* @stderr
%67 = call i32 (i32, i8*, ...) @fprintf(i32 %66, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%68 = load i32*, i32** %6
%69 = call i32 @fclose(i32* %68)
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 Abaqus2oo - RoBo - 2003;\0A\0A\00"
@.str.5 = [20 x i8] c"Refer dom(domain);\0A\00"
@.str.6 = [49 x i8] c"Refer nset(dom[NODESET_PO]); nset.build_hash();\0A\00"
@.str.7 = [12 x i8] c"%d,%Lf,%Lf\0A\00"
@EOF = global i32 0
@.str.8 = [39 x i8] c"nset.define(%d, %20.15E, %20.15E, 0);\0A\00"
@.str.9 = [8 x i8] c"\0A%% EOF\00"
@.str.10 = [7 x i8] c"done.\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = icmp slt i32 %0, 2
%7 = load i32, i32* @stderr
br i1 %6, label %8, label %12
8: ; preds = %2
%9 = load i8*, i8** %1
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = tail call i32 @exit(i32 1)
unreachable
12: ; preds = %2
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = load i32, i32* @stdin
%17 = tail call i32 @fflush(i32 %16)
%18 = load i8*, i8** %13
%19 = tail call i32* @fopen(i8* %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%20 = icmp eq i32* %19, null
br i1 %20, label %21, label %25
21: ; preds = %12
%22 = load i32, i32* @stderr
%23 = tail call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%24 = tail call i32 @exit(i32 1)
unreachable
25: ; preds = %12
%26 = load i32, i32* @stdout
%27 = tail call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0))
%28 = load i32, i32* @stdout
%29 = tail call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%30 = load i32, i32* @stdout
%31 = tail call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.6, i64 0, i64 0))
%32 = bitcast i32* %3 to i8*
%33 = bitcast double* %4 to i8*
%34 = bitcast double* %5 to i8*
br label %35
35: ; preds = %40, %25
%36 = call i32 @fscanf(i32* %19, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32* %3, double* %4, double* %5)
%37 = load i32, i32* @EOF
%38 = icmp eq i32 %36, %37
br i1 %38, label %39, label %40
39: ; preds = %35
br label %48
40: ; preds = %35
%41 = load i32, i32* @stdout
%42 = load i32, i32* %3
%43 = load double, double* %4
%44 = load double, double* %5
%45 = call i32 (i32, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.8, i64 0, i64 0), i32 %42, double %43, double %44)
%46 = load i32, i32* @EOF
%47 = icmp eq i32 %36, %46
br i1 %47, label %48, label %35
48: ; preds = %40, %39
%49 = load i32, i32* @stdout
%50 = call i32 (i32, i8*, ...) @fprintf(i32 %49, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
%51 = load i32, i32* @stderr
%52 = call i32 (i32, i8*, ...) @fprintf(i32 %51, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%53 = call i32 @fclose(i32* %19)
ret i32 0
}