#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 node_t;

/* Variables and functions */
int fleury(int *, int, int *);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ graph_destroy(int *, int);
int graph_read_from_std(int **, int *, int *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  struct node_t *g = 0;
  int n = 0, m = 0;
  int *out = 0;
  int size = 0;
  int i = 0;
  int ret = 0;
  int output = 1;
  if (argc == 2) {
    output = 0;
  }
  ret = graph_read_from_std(&g, &n, &m);
  if (ret == 0) {
    if (n >= 3) {
      out = (int *)malloc((m + 1) * sizeof(int));
      size = fleury(g, n, out);
      if (size == m && out[size] == out[0]) {
        if (output) {
          for (i = 0; i <= size; ++i)
            printf("%d ", out[i] + 1);
          printf("\n");
        }
      } else
        printf("Il n'existe pas de solutions : tous les sommets ne sont pas de "
               "dégrés pair.\n");
    } else
      printf("Il n'existe pas de solutions : moins de 3 sommets\n");
  } else
    printf("Une erreur est survenue ...\n");
  graph_destroy(g, n);
  free(g);
  free(out);
  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)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x1,-0x38(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    11c1 <main+0x61>
movl   $0x0,-0x38(%rbp)
lea    -0x18(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1070 <graph_read_from_std@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jne    12b6 <main+0x156>
cmpl   $0x3,-0x1c(%rbp)
jl     12a3 <main+0x143>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x28(%rbp),%rdx
call   1050 <fleury@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    1290 <main+0x130>
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jne    1290 <main+0x130>
cmpl   $0x0,-0x38(%rbp)
je     128b <main+0x12b>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jg     127d <main+0x11d>
mov    -0x28(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
add    $0x1,%esi
lea    0xd98(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1247 <main+0xe7>
lea    0xe1d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    129e <main+0x13e>
lea    0xd6d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    12b1 <main+0x151>
lea    0xda9(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    12c4 <main+0x164>
lea    0xdc9(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1040 <graph_destroy@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebp
movq   $0x0,0x10(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0xc(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1090 <graph_read_from_std@plt>
test   %eax,%eax
je     11c9 <main+0x49>
lea    0xe40(%rip),%rdi
jmp    127c <main+0xfc>
cmpl   $0x3,0x8(%rsp)
jl     1275 <main+0xf5>
mov    0xc(%rsp),%eax
lea    0x4(,%rax,4),%edi
call   10a0 <malloc@plt>
mov    %rax,%rbx
mov    0x10(%rsp),%rdi
mov    0x8(%rsp),%esi
mov    %rax,%rdx
call   1070 <fleury@plt>
cmp    0xc(%rsp),%eax
jne    12b0 <main+0x130>
mov    %eax,%r14d
cltq
mov    (%rbx,%rax,4),%esi
cmp    (%rbx),%esi
jne    12b0 <main+0x130>
cmp    $0x2,%ebp
je     1283 <main+0x103>
test   %r14d,%r14d
js     1269 <main+0xe9>
add    $0x1,%esi
lea    0xdda(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
test   %r14d,%r14d
je     1269 <main+0xe9>
add    $0x1,%r14d
mov    $0x1,%ebp
lea    0xdbe(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rbx,%rbp,4),%esi
add    $0x1,%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r14
jne    1250 <main+0xd0>
mov    $0xa,%edi
call   1040 <putchar@plt>
jmp    1283 <main+0x103>
lea    0xda4(%rip),%rdi
call   1060 <puts@plt>
xor    %ebx,%ebx
mov    0x10(%rsp),%rdi
mov    0x8(%rsp),%esi
call   1050 <graph_destroy@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd9b(%rip),%rdi
call   1060 <puts@plt>
jmp    1283 <main+0x103>

LLVM IR (-O0):
%struct.node_t = type opaque
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [79 x i8] c"Il n'existe pas de solutions : tous les sommets ne sont pas de d\C3\A9gr\C3\A9s pair.\0A\00"
@.str.3 = [51 x i8] c"Il n'existe pas de solutions : moins de 3 sommets\0A\00"
@.str.4 = [29 x i8] c"Une erreur est survenue ...\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.node_t*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.node_t* null, %struct.node_t** %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32* null, i32** %9
store i32 0, i32* %10
store i32 0, i32* %11
store i32 0, i32* %12
store i32 1, i32* %13
%14 = load i32, i32* %4
%15 = icmp eq i32 %14, 2
br i1 %15, label %16, label %17
16: ; preds = %2
store i32 0, i32* %13
br label %17
17: ; preds = %16, %2
%18 = bitcast %struct.node_t** %6 to i32**
%19 = call i32 @graph_read_from_std(i32** %18, i32* %7, i32* %8)
store i32 %19, i32* %12
%20 = load i32, i32* %12
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %79
22: ; preds = %17
%23 = load i32, i32* %7
%24 = icmp sge i32 %23, 3
br i1 %24, label %25, label %76
25: ; preds = %22
%26 = load i32, i32* %8
%27 = add nsw i32 %26, 1
%28 = sext i32 %27 to i64
%29 = mul i64 %28, 4
%30 = trunc i64 %29 to i32
%31 = call i64 @malloc(i32 %30)
%32 = inttoptr i64 %31 to i32*
store i32* %32, i32** %9
%33 = load %struct.node_t*, %struct.node_t** %6
%34 = bitcast %struct.node_t* %33 to i32*
%35 = load i32, i32* %7
%36 = load i32*, i32** %9
%37 = call i32 @fleury(i32* %34, i32 %35, i32* %36)
store i32 %37, i32* %10
%38 = load i32, i32* %10
%39 = load i32, i32* %8
%40 = icmp eq i32 %38, %39
br i1 %40, label %41, label %73
41: ; preds = %25
%42 = load i32*, i32** %9
%43 = load i32, i32* %10
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i32, i32* %42, i64 %44
%46 = load i32, i32* %45
%47 = load i32*, i32** %9
%48 = getelementptr inbounds i32, i32* %47, i64 0
%49 = load i32, i32* %48
%50 = icmp eq i32 %46, %49
br i1 %50, label %51, label %73
51: ; preds = %41
%52 = load i32, i32* %13
%53 = icmp ne i32 %52, 0
br i1 %53, label %54, label %72
54: ; preds = %51
store i32 0, i32* %11
br label %55
55: ; preds = %67, %54
%56 = load i32, i32* %11
%57 = load i32, i32* %10
%58 = icmp sle i32 %56, %57
br i1 %58, label %59, label %70
59: ; preds = %55
%60 = load i32*, i32** %9
%61 = load i32, i32* %11
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds i32, i32* %60, i64 %62
%64 = load i32, i32* %63
%65 = add nsw i32 %64, 1
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %65)
br label %67
67: ; preds = %59
%68 = load i32, i32* %11
%69 = add nsw i32 %68, 1
store i32 %69, i32* %11
br label %55
70: ; preds = %55
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %72
72: ; preds = %70, %51
br label %75
73: ; preds = %41, %25
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.2, i64 0, i64 0))
br label %75
75: ; preds = %73, %72
br label %78
76: ; preds = %22
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.3, i64 0, i64 0))
br label %78
78: ; preds = %76, %75
br label %81
79: ; preds = %17
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
br label %81
81: ; preds = %79, %78
%82 = load %struct.node_t*, %struct.node_t** %6
%83 = bitcast %struct.node_t* %82 to i32*
%84 = load i32, i32* %7
%85 = call i32 @graph_destroy(i32* %83, i32 %84)
%86 = load %struct.node_t*, %struct.node_t** %6
%87 = bitcast %struct.node_t* %86 to i32*
%88 = call i32 @free(i32* %87)
%89 = load i32*, i32** %9
%90 = call i32 @free(i32* %89)
ret i32 0
}

LLVM IR (-O2):
%struct.node_t = type opaque
@.str = [4 x i8] c"%d \00"
@str = [28 x i8] c"Une erreur est survenue ...\00"
@str.5 = [50 x i8] c"Il n'existe pas de solutions : moins de 3 sommets\00"
@str.6 = [78 x i8] c"Il n'existe pas de solutions : tous les sommets ne sont pas de d\C3\A9gr\C3\A9s pair.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.node_t*
%4 = alloca i32
%5 = alloca i32
%6 = bitcast %struct.node_t** %3 to i8*
store %struct.node_t* null, %struct.node_t** %3
%7 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%8 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%9 = icmp eq i32 %0, 2
%10 = bitcast %struct.node_t** %3 to i32**
%11 = call i32 @graph_read_from_std(i32** %10, i32* %4, i32* %5)
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %56
13: ; preds = %2
%14 = load i32, i32* %4
%15 = icmp sgt i32 %14, 2
br i1 %15, label %16, label %54
16: ; preds = %13
%17 = load i32, i32* %5
%18 = shl i32 %17, 2
%19 = add i32 %18, 4
%20 = call i64 @malloc(i32 %19)
%21 = inttoptr i64 %20 to i32*
%22 = load i32*, i32** %10
%23 = load i32, i32* %4
%24 = call i32 @fleury(i32* %22, i32 %23, i32* %21)
%25 = load i32, i32* %5
%26 = icmp eq i32 %24, %25
br i1 %26, label %27, label %52
27: ; preds = %16
%28 = sext i32 %24 to i64
%29 = getelementptr inbounds i32, i32* %21, i64 %28
%30 = load i32, i32* %29
%31 = load i32, i32* %21
%32 = icmp eq i32 %30, %31
br i1 %32, label %33, label %52
33: ; preds = %27
br i1 %9, label %58, label %34
34: ; preds = %33
%35 = icmp slt i32 %24, 0
br i1 %35, label %50, label %36
36: ; preds = %34
%37 = add nuw i32 %24, 1
%38 = zext i32 %37 to i64
%39 = add nsw i32 %30, 1
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %39)
%41 = icmp eq i32 %24, 0
br i1 %41, label %50, label %42
42: ; preds = %36, %42
%43 = phi i64 [ %48, %42 ], [ 1, %36 ]
%44 = getelementptr inbounds i32, i32* %21, i64 %43
%45 = load i32, i32* %44
%46 = add nsw i32 %45, 1
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %46)
%48 = add nuw nsw i64 %43, 1
%49 = icmp eq i64 %48, %38
br i1 %49, label %50, label %42
50: ; preds = %42, %36, %34
%51 = call i32 @putchar(i32 10)
br label %58
52: ; preds = %27, %16
%53 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.6, i64 0, i64 0))
br label %58
54: ; preds = %13
%55 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.5, i64 0, i64 0))
br label %58
56: ; preds = %2
%57 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
br label %58
58: ; preds = %54, %33, %50, %52, %56
%59 = phi i32* [ %21, %50 ], [ %21, %33 ], [ %21, %52 ], [ null, %54 ], [ null, %56 ]
%60 = load i32*, i32** %10
%61 = load i32, i32* %4
%62 = call i32 @graph_destroy(i32* %60, i32 %61)
%63 = load i32*, i32** %10
%64 = call i32 @free(i32* %63)
%65 = call i32 @free(i32* %59)
ret i32 0
}