#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 Fastway(int *, int *, int *, int *, int *, int *, int, int *, int *, int *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ reverse_PRINT_STATIONS(int *, int *, int, int);
int main() {
  int n = 6;
  int e[2];
  e[0] = 2;
  e[1] = 4;
  int x[2];
  x[0] = 3;
  x[1] = 2;
  int t1[5], t2[5];
  t1[0] = 2;
  t1[1] = 3;
  t1[2] = 1;
  t1[3] = 3;
  t1[4] = 4;
  t2[0] = 2;
  t2[1] = 1;
  t2[2] = 2;
  t2[3] = 2;
  t2[4] = 1;
  int a1[6], a2[6];
  a1[0] = 7;
  a1[1] = 9;
  a1[2] = 3;
  a1[3] = 4;
  a1[4] = 8;
  a1[5] = 4;
  a2[0] = 8;
  a2[1] = 5;
  a2[2] = 6;
  a2[3] = 4;
  a2[4] = 5;
  a2[5] = 7;
  int value;
  int *l1 = (int *)malloc((n - 1) * sizeof(int));
  int *l2 = (int *)malloc((n - 1) * sizeof(int));
  int way = Fastway(a1, a2, t1, t2, e, x, n, l1, l2, &value);
  printf("value = %d\n", value);
  reverse_PRINT_STATIONS(l1, l2, way, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0xd8,%rsp
movl   $0x0,-0xc(%rbp)
movl   $0x6,-0x10(%rbp)
movl   $0x2,-0x18(%rbp)
movl   $0x4,-0x14(%rbp)
movl   $0x3,-0x20(%rbp)
movl   $0x2,-0x1c(%rbp)
movl   $0x2,-0x40(%rbp)
movl   $0x3,-0x3c(%rbp)
movl   $0x1,-0x38(%rbp)
movl   $0x3,-0x34(%rbp)
movl   $0x4,-0x30(%rbp)
movl   $0x2,-0x60(%rbp)
movl   $0x1,-0x5c(%rbp)
movl   $0x2,-0x58(%rbp)
movl   $0x2,-0x54(%rbp)
movl   $0x1,-0x50(%rbp)
movl   $0x7,-0x80(%rbp)
movl   $0x9,-0x7c(%rbp)
movl   $0x3,-0x78(%rbp)
movl   $0x4,-0x74(%rbp)
movl   $0x8,-0x70(%rbp)
movl   $0x4,-0x6c(%rbp)
movl   $0x8,-0xa0(%rbp)
movl   $0x5,-0x9c(%rbp)
movl   $0x6,-0x98(%rbp)
movl   $0x4,-0x94(%rbp)
movl   $0x5,-0x90(%rbp)
movl   $0x7,-0x8c(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0xb0(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0xb8(%rbp)
lea    -0x80(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
lea    -0x40(%rbp),%rdx
lea    -0x60(%rbp),%rcx
lea    -0x18(%rbp),%r8
lea    -0x20(%rbp),%r9
mov    -0x10(%rbp),%ebx
mov    -0xb0(%rbp),%r11
mov    -0xb8(%rbp),%r10
lea    -0xa4(%rbp),%rax
mov    %ebx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
call   1050 <Fastway@plt>
mov    %eax,-0xbc(%rbp)
mov    -0xa4(%rbp),%esi
lea    0xd4d(%rip),%rdi
call   1040 <printf@plt>
mov    -0xb0(%rbp),%rdi
mov    -0xb8(%rbp),%rsi
mov    -0xbc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <reverse_PRINT_STATIONS@plt>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0xa0,%rsp
movabs $0x400000002,%rax
mov    %rax,0x18(%rsp)
movabs $0x200000003,%rax
mov    %rax,0x10(%rsp)
movaps 0xe90(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movl   $0x4,0x50(%rsp)
movaps 0xe8c(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movl   $0x1,0x30(%rsp)
movaps 0xe88(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movabs $0x400000008,%rax
mov    %rax,0x90(%rsp)
movaps 0xe77(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movabs $0x700000005,%rax
mov    %rax,0x70(%rsp)
mov    $0x14,%edi
call   1060 <malloc@plt>
mov    %rax,%r14
mov    $0x14,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xc(%rsp),%rax
lea    0x80(%rsp),%rdi
lea    0x60(%rsp),%rsi
lea    0x40(%rsp),%rdx
lea    0x20(%rsp),%rcx
lea    0x18(%rsp),%r8
lea    0x10(%rsp),%r9
push   %rax
push   %rbx
push   %r14
push   $0x6
call   1050 <Fastway@plt>
add    $0x20,%rsp
mov    %eax,%ebp
mov    0xc(%rsp),%esi
lea    0xe17(%rip),%rdi
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    $0x6,%ecx
call   1030 <reverse_PRINT_STATIONS@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"value = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [2 x i32]
%4 = alloca [2 x i32]
%5 = alloca [5 x i32]
%6 = alloca [5 x i32]
%7 = alloca [6 x i32]
%8 = alloca [6 x i32]
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32
store i32 0, i32* %1
store i32 6, i32* %2
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32 2, i32* %13
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
store i32 4, i32* %14
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 3, i32* %15
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 2, i32* %16
%17 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0, i64 0
store i32 2, i32* %17
%18 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0, i64 1
store i32 3, i32* %18
%19 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0, i64 2
store i32 1, i32* %19
%20 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0, i64 3
store i32 3, i32* %20
%21 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0, i64 4
store i32 4, i32* %21
%22 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 0
store i32 2, i32* %22
%23 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 1
store i32 1, i32* %23
%24 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 2
store i32 2, i32* %24
%25 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 3
store i32 2, i32* %25
%26 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 4
store i32 1, i32* %26
%27 = getelementptr inbounds [6 x i32], [6 x i32]* %7, i64 0, i64 0
store i32 7, i32* %27
%28 = getelementptr inbounds [6 x i32], [6 x i32]* %7, i64 0, i64 1
store i32 9, i32* %28
%29 = getelementptr inbounds [6 x i32], [6 x i32]* %7, i64 0, i64 2
store i32 3, i32* %29
%30 = getelementptr inbounds [6 x i32], [6 x i32]* %7, i64 0, i64 3
store i32 4, i32* %30
%31 = getelementptr inbounds [6 x i32], [6 x i32]* %7, i64 0, i64 4
store i32 8, i32* %31
%32 = getelementptr inbounds [6 x i32], [6 x i32]* %7, i64 0, i64 5
store i32 4, i32* %32
%33 = getelementptr inbounds [6 x i32], [6 x i32]* %8, i64 0, i64 0
store i32 8, i32* %33
%34 = getelementptr inbounds [6 x i32], [6 x i32]* %8, i64 0, i64 1
store i32 5, i32* %34
%35 = getelementptr inbounds [6 x i32], [6 x i32]* %8, i64 0, i64 2
store i32 6, i32* %35
%36 = getelementptr inbounds [6 x i32], [6 x i32]* %8, i64 0, i64 3
store i32 4, i32* %36
%37 = getelementptr inbounds [6 x i32], [6 x i32]* %8, i64 0, i64 4
store i32 5, i32* %37
%38 = getelementptr inbounds [6 x i32], [6 x i32]* %8, i64 0, i64 5
store i32 7, i32* %38
%39 = load i32, i32* %2
%40 = sub nsw i32 %39, 1
%41 = sext i32 %40 to i64
%42 = mul i64 %41, 4
%43 = trunc i64 %42 to i32
%44 = call i64 @malloc(i32 %43)
%45 = inttoptr i64 %44 to i32*
store i32* %45, i32** %10
%46 = load i32, i32* %2
%47 = sub nsw i32 %46, 1
%48 = sext i32 %47 to i64
%49 = mul i64 %48, 4
%50 = trunc i64 %49 to i32
%51 = call i64 @malloc(i32 %50)
%52 = inttoptr i64 %51 to i32*
store i32* %52, i32** %11
%53 = getelementptr inbounds [6 x i32], [6 x i32]* %7, i64 0, i64 0
%54 = getelementptr inbounds [6 x i32], [6 x i32]* %8, i64 0, i64 0
%55 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0, i64 0
%56 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 0
%57 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%58 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%59 = load i32, i32* %2
%60 = load i32*, i32** %10
%61 = load i32*, i32** %11
%62 = call i32 @Fastway(i32* %53, i32* %54, i32* %55, i32* %56, i32* %57, i32* %58, i32 %59, i32* %60, i32* %61, i32* %9)
store i32 %62, i32* %12
%63 = load i32, i32* %9
%64 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %63)
%65 = load i32*, i32** %10
%66 = load i32*, i32** %11
%67 = load i32, i32* %12
%68 = load i32, i32* %2
%69 = call i32 @reverse_PRINT_STATIONS(i32* %65, i32* %66, i32 %67, i32 %68)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"value = %d\0A\00"
define i32 @main() {
%1 = alloca [2 x i32]
%2 = alloca [2 x i32]
%3 = alloca [5 x i32]
%4 = alloca [5 x i32]
%5 = alloca [6 x i32]
%6 = alloca [6 x i32]
%7 = alloca i32
%8 = bitcast [2 x i32]* %1 to i8*
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
store i32 2, i32* %9
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
store i32 4, i32* %10
%11 = bitcast [2 x i32]* %2 to i8*
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
store i32 3, i32* %12
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
store i32 2, i32* %13
%14 = bitcast [5 x i32]* %3 to i8*
%15 = bitcast [5 x i32]* %4 to i8*
%16 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%17 = bitcast [5 x i32]* %3 to <4 x i32>*
store <4 x i32> <i32 2, i32 3, i32 1, i32 3>, <4 x i32>* %17
%18 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 4
store i32 4, i32* %18
%19 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%20 = bitcast [5 x i32]* %4 to <4 x i32>*
store <4 x i32> <i32 2, i32 1, i32 2, i32 2>, <4 x i32>* %20
%21 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 4
store i32 1, i32* %21
%22 = bitcast [6 x i32]* %5 to i8*
%23 = bitcast [6 x i32]* %6 to i8*
%24 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 0
%25 = bitcast [6 x i32]* %5 to <4 x i32>*
store <4 x i32> <i32 7, i32 9, i32 3, i32 4>, <4 x i32>* %25
%26 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 4
store i32 8, i32* %26
%27 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 5
store i32 4, i32* %27
%28 = getelementptr inbounds [6 x i32], [6 x i32]* %6, i64 0, i64 0
%29 = bitcast [6 x i32]* %6 to <4 x i32>*
store <4 x i32> <i32 8, i32 5, i32 6, i32 4>, <4 x i32>* %29
%30 = getelementptr inbounds [6 x i32], [6 x i32]* %6, i64 0, i64 4
store i32 5, i32* %30
%31 = getelementptr inbounds [6 x i32], [6 x i32]* %6, i64 0, i64 5
store i32 7, i32* %31
%32 = bitcast i32* %7 to i8*
%33 = tail call i64 @malloc(i32 20)
%34 = inttoptr i64 %33 to i32*
%35 = tail call i64 @malloc(i32 20)
%36 = inttoptr i64 %35 to i32*
%37 = call i32 @Fastway(i32* %24, i32* %28, i32* %16, i32* %19, i32* %9, i32* %12, i32 6, i32* %34, i32* %36, i32* %7)
%38 = load i32, i32* %7
%39 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %38)
%40 = call i32 @reverse_PRINT_STATIONS(i32* %34, i32* %36, i32 %37, i32 6)
ret i32 0
}