#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 /*<<< orphan*/ eval_8cards_fast(int, int, int, int, int, int, int, int);
short minv(short, int /*<<< orphan*/);
short eval_9cards_fast(int c1, int c2, int c3, int c4, int c5, int c6, int c7,
                       int c8, int c9) {
  short best = 10000;
  best = minv(best, eval_8cards_fast(c1, c2, c3, c4, c5, c6, c7, c8));
  best = minv(best, eval_8cards_fast(c9, c2, c3, c4, c5, c6, c7, c8));
  best = minv(best, eval_8cards_fast(c1, c9, c3, c4, c5, c6, c7, c8));
  best = minv(best, eval_8cards_fast(c1, c2, c9, c4, c5, c6, c7, c8));
  best = minv(best, eval_8cards_fast(c1, c2, c3, c9, c5, c6, c7, c8));
  best = minv(best, eval_8cards_fast(c1, c2, c3, c4, c9, c6, c7, c8));
  best = minv(best, eval_8cards_fast(c1, c2, c3, c4, c5, c9, c7, c8));
  best = minv(best, eval_8cards_fast(c1, c2, c3, c4, c5, c6, c9, c8));
  return best;
}


x86 assembly (clang, -O0):
<eval_9cards_fast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
movw   $0x2710,-0x1a(%rbp)
mov    -0x1a(%rbp),%ax
mov    %ax,-0x2a(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    0x10(%rbp),%r10d
mov    0x18(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <eval_8cards_fast@plt>
mov    %eax,%esi
mov    -0x2a(%rbp),%ax
movswl %ax,%edi
call   1040 <minv@plt>
mov    %ax,-0x1a(%rbp)
mov    -0x1a(%rbp),%ax
mov    %ax,-0x28(%rbp)
mov    0x20(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    0x10(%rbp),%r10d
mov    0x18(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <eval_8cards_fast@plt>
mov    %eax,%esi
mov    -0x28(%rbp),%ax
movswl %ax,%edi
call   1040 <minv@plt>
mov    %ax,-0x1a(%rbp)
mov    -0x1a(%rbp),%ax
mov    %ax,-0x26(%rbp)
mov    -0x4(%rbp),%edi
mov    0x20(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    0x10(%rbp),%r10d
mov    0x18(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <eval_8cards_fast@plt>
mov    %eax,%esi
mov    -0x26(%rbp),%ax
movswl %ax,%edi
call   1040 <minv@plt>
mov    %ax,-0x1a(%rbp)
mov    -0x1a(%rbp),%ax
mov    %ax,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x20(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    0x10(%rbp),%r10d
mov    0x18(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <eval_8cards_fast@plt>
mov    %eax,%esi
mov    -0x24(%rbp),%ax
movswl %ax,%edi
call   1040 <minv@plt>
mov    %ax,-0x1a(%rbp)
mov    -0x1a(%rbp),%ax
mov    %ax,-0x22(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    0x20(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    0x10(%rbp),%r10d
mov    0x18(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <eval_8cards_fast@plt>
mov    %eax,%esi
mov    -0x22(%rbp),%ax
movswl %ax,%edi
call   1040 <minv@plt>
mov    %ax,-0x1a(%rbp)
mov    -0x1a(%rbp),%ax
mov    %ax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    0x20(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    0x10(%rbp),%r10d
mov    0x18(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <eval_8cards_fast@plt>
mov    %eax,%esi
mov    -0x20(%rbp),%ax
movswl %ax,%edi
call   1040 <minv@plt>
mov    %ax,-0x1a(%rbp)
mov    -0x1a(%rbp),%ax
mov    %ax,-0x1e(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    0x20(%rbp),%r9d
mov    0x10(%rbp),%r10d
mov    0x18(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <eval_8cards_fast@plt>
mov    %eax,%esi
mov    -0x1e(%rbp),%ax
movswl %ax,%edi
call   1040 <minv@plt>
mov    %ax,-0x1a(%rbp)
mov    -0x1a(%rbp),%ax
mov    %ax,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    0x20(%rbp),%r10d
mov    0x18(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <eval_8cards_fast@plt>
mov    %eax,%esi
mov    -0x1c(%rbp),%ax
movswl %ax,%edi
call   1040 <minv@plt>
mov    %ax,-0x1a(%rbp)
movswl -0x1a(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_9cards_fast>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r9d,0x8(%rsp)
mov    %edi,0xc(%rsp)
mov    0x80(%rsp),%r12d
mov    0x70(%rsp),%eax
mov    %rax,0x20(%rsp)
mov    0x78(%rsp),%ebp
mov    %esi,%r15d
mov    %esi,0x18(%rsp)
mov    %edx,%r14d
mov    %ecx,%r13d
mov    %r8d,%ebx
mov    %r8d,0x10(%rsp)
push   %rbp
push   %rax
call   1030 <eval_8cards_fast@plt>
add    $0x10,%rsp
mov    $0x2710,%edi
mov    %eax,%esi
call   1040 <minv@plt>
mov    %ax,0x6(%rsp)
mov    %r12d,%edi
mov    %r12,0x28(%rsp)
mov    %r15d,%esi
mov    %r14d,%edx
mov    %r14d,%r15d
mov    %r14d,0x14(%rsp)
mov    %r13d,%ecx
mov    %r13d,%r14d
mov    %ebx,%r8d
mov    0x8(%rsp),%ebx
mov    %ebx,%r9d
push   %rbp
mov    %rbp,%r13
push   0x28(%rsp)
call   1030 <eval_8cards_fast@plt>
add    $0x10,%rsp
movswl 0x6(%rsp),%edi
mov    %eax,%esi
call   1040 <minv@plt>
mov    %ax,0x6(%rsp)
mov    0xc(%rsp),%ebp
mov    %ebp,%edi
mov    %r12d,%esi
mov    %r15d,%edx
mov    %r14d,%ecx
mov    %r14d,0x1c(%rsp)
mov    0x10(%rsp),%r8d
mov    %ebx,%r9d
push   %r13
mov    %r13,0x38(%rsp)
mov    0x28(%rsp),%r12
push   %r12
call   1030 <eval_8cards_fast@plt>
add    $0x10,%rsp
movswl 0x6(%rsp),%edi
mov    %eax,%esi
call   1040 <minv@plt>
mov    %eax,%r15d
mov    %ebp,%edi
mov    0x18(%rsp),%ebx
mov    %ebx,%esi
mov    0x28(%rsp),%rdx
mov    %r14d,%ecx
mov    0x10(%rsp),%r14d
mov    %r14d,%r8d
mov    0x8(%rsp),%ebp
mov    %ebp,%r9d
push   %r13
push   %r12
call   1030 <eval_8cards_fast@plt>
add    $0x10,%rsp
movswl %r15w,%edi
mov    %eax,%esi
call   1040 <minv@plt>
mov    %ax,0x6(%rsp)
mov    0xc(%rsp),%r13d
mov    %r13d,%edi
mov    %ebx,%esi
mov    0x14(%rsp),%ebx
mov    %ebx,%edx
mov    0x28(%rsp),%r15
mov    %r15d,%ecx
mov    %r14d,%r8d
mov    %ebp,%r9d
push   0x30(%rsp)
push   %r12
call   1030 <eval_8cards_fast@plt>
add    $0x10,%rsp
movswl 0x6(%rsp),%edi
mov    %eax,%esi
call   1040 <minv@plt>
mov    %ax,0x6(%rsp)
mov    %r13d,%r14d
mov    %r13d,%edi
mov    0x18(%rsp),%r13d
mov    %r13d,%esi
mov    %ebx,%edx
mov    0x1c(%rsp),%ebx
mov    %ebx,%ecx
mov    %r15d,%r8d
mov    %r15,%rbp
mov    0x8(%rsp),%r9d
mov    0x30(%rsp),%r15
push   %r15
push   %r12
call   1030 <eval_8cards_fast@plt>
add    $0x10,%rsp
movswl 0x6(%rsp),%edi
mov    %eax,%esi
call   1040 <minv@plt>
mov    %eax,%r12d
mov    %r14d,%edi
mov    %r13d,%esi
mov    0x14(%rsp),%r14d
mov    %r14d,%edx
mov    %ebx,%ecx
mov    0x10(%rsp),%ebx
mov    %ebx,%r8d
mov    %ebp,%r9d
push   %r15
push   0x28(%rsp)
call   1030 <eval_8cards_fast@plt>
add    $0x10,%rsp
movswl %r12w,%edi
mov    %eax,%esi
call   1040 <minv@plt>
mov    %eax,%ebp
mov    0xc(%rsp),%edi
mov    %r13d,%esi
mov    %r14d,%edx
mov    0x1c(%rsp),%ecx
mov    %ebx,%r8d
mov    0x8(%rsp),%r9d
push   %r15
push   0x30(%rsp)
call   1030 <eval_8cards_fast@plt>
add    $0x10,%rsp
movswl %bp,%edi
mov    %eax,%esi
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <minv@plt>

LLVM IR (-O0):
define signext i16 @eval_9cards_fast(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8) {
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i16
store i32 %0, i32* %10
store i32 %1, i32* %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store i32 %7, i32* %17
store i32 %8, i32* %18
store i16 10000, i16* %19
%20 = load i16, i16* %19
%21 = load i32, i32* %10
%22 = load i32, i32* %11
%23 = load i32, i32* %12
%24 = load i32, i32* %13
%25 = load i32, i32* %14
%26 = load i32, i32* %15
%27 = load i32, i32* %16
%28 = load i32, i32* %17
%29 = call i32 @eval_8cards_fast(i32 %21, i32 %22, i32 %23, i32 %24, i32 %25, i32 %26, i32 %27, i32 %28)
%30 = call signext i16 @minv(i16 signext %20, i32 %29)
store i16 %30, i16* %19
%31 = load i16, i16* %19
%32 = load i32, i32* %18
%33 = load i32, i32* %11
%34 = load i32, i32* %12
%35 = load i32, i32* %13
%36 = load i32, i32* %14
%37 = load i32, i32* %15
%38 = load i32, i32* %16
%39 = load i32, i32* %17
%40 = call i32 @eval_8cards_fast(i32 %32, i32 %33, i32 %34, i32 %35, i32 %36, i32 %37, i32 %38, i32 %39)
%41 = call signext i16 @minv(i16 signext %31, i32 %40)
store i16 %41, i16* %19
%42 = load i16, i16* %19
%43 = load i32, i32* %10
%44 = load i32, i32* %18
%45 = load i32, i32* %12
%46 = load i32, i32* %13
%47 = load i32, i32* %14
%48 = load i32, i32* %15
%49 = load i32, i32* %16
%50 = load i32, i32* %17
%51 = call i32 @eval_8cards_fast(i32 %43, i32 %44, i32 %45, i32 %46, i32 %47, i32 %48, i32 %49, i32 %50)
%52 = call signext i16 @minv(i16 signext %42, i32 %51)
store i16 %52, i16* %19
%53 = load i16, i16* %19
%54 = load i32, i32* %10
%55 = load i32, i32* %11
%56 = load i32, i32* %18
%57 = load i32, i32* %13
%58 = load i32, i32* %14
%59 = load i32, i32* %15
%60 = load i32, i32* %16
%61 = load i32, i32* %17
%62 = call i32 @eval_8cards_fast(i32 %54, i32 %55, i32 %56, i32 %57, i32 %58, i32 %59, i32 %60, i32 %61)
%63 = call signext i16 @minv(i16 signext %53, i32 %62)
store i16 %63, i16* %19
%64 = load i16, i16* %19
%65 = load i32, i32* %10
%66 = load i32, i32* %11
%67 = load i32, i32* %12
%68 = load i32, i32* %18
%69 = load i32, i32* %14
%70 = load i32, i32* %15
%71 = load i32, i32* %16
%72 = load i32, i32* %17
%73 = call i32 @eval_8cards_fast(i32 %65, i32 %66, i32 %67, i32 %68, i32 %69, i32 %70, i32 %71, i32 %72)
%74 = call signext i16 @minv(i16 signext %64, i32 %73)
store i16 %74, i16* %19
%75 = load i16, i16* %19
%76 = load i32, i32* %10
%77 = load i32, i32* %11
%78 = load i32, i32* %12
%79 = load i32, i32* %13
%80 = load i32, i32* %18
%81 = load i32, i32* %15
%82 = load i32, i32* %16
%83 = load i32, i32* %17
%84 = call i32 @eval_8cards_fast(i32 %76, i32 %77, i32 %78, i32 %79, i32 %80, i32 %81, i32 %82, i32 %83)
%85 = call signext i16 @minv(i16 signext %75, i32 %84)
store i16 %85, i16* %19
%86 = load i16, i16* %19
%87 = load i32, i32* %10
%88 = load i32, i32* %11
%89 = load i32, i32* %12
%90 = load i32, i32* %13
%91 = load i32, i32* %14
%92 = load i32, i32* %18
%93 = load i32, i32* %16
%94 = load i32, i32* %17
%95 = call i32 @eval_8cards_fast(i32 %87, i32 %88, i32 %89, i32 %90, i32 %91, i32 %92, i32 %93, i32 %94)
%96 = call signext i16 @minv(i16 signext %86, i32 %95)
store i16 %96, i16* %19
%97 = load i16, i16* %19
%98 = load i32, i32* %10
%99 = load i32, i32* %11
%100 = load i32, i32* %12
%101 = load i32, i32* %13
%102 = load i32, i32* %14
%103 = load i32, i32* %15
%104 = load i32, i32* %18
%105 = load i32, i32* %17
%106 = call i32 @eval_8cards_fast(i32 %98, i32 %99, i32 %100, i32 %101, i32 %102, i32 %103, i32 %104, i32 %105)
%107 = call signext i16 @minv(i16 signext %97, i32 %106)
store i16 %107, i16* %19
%108 = load i16, i16* %19
ret i16 %108
}

LLVM IR (-O2):
define signext i16 @eval_9cards_fast(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8) {
%10 = tail call i32 @eval_8cards_fast(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7)
%11 = tail call signext i16 @minv(i16 signext 10000, i32 %10)
%12 = tail call i32 @eval_8cards_fast(i32 %8, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7)
%13 = tail call signext i16 @minv(i16 signext %11, i32 %12)
%14 = tail call i32 @eval_8cards_fast(i32 %0, i32 %8, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7)
%15 = tail call signext i16 @minv(i16 signext %13, i32 %14)
%16 = tail call i32 @eval_8cards_fast(i32 %0, i32 %1, i32 %8, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7)
%17 = tail call signext i16 @minv(i16 signext %15, i32 %16)
%18 = tail call i32 @eval_8cards_fast(i32 %0, i32 %1, i32 %2, i32 %8, i32 %4, i32 %5, i32 %6, i32 %7)
%19 = tail call signext i16 @minv(i16 signext %17, i32 %18)
%20 = tail call i32 @eval_8cards_fast(i32 %0, i32 %1, i32 %2, i32 %3, i32 %8, i32 %5, i32 %6, i32 %7)
%21 = tail call signext i16 @minv(i16 signext %19, i32 %20)
%22 = tail call i32 @eval_8cards_fast(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %8, i32 %6, i32 %7)
%23 = tail call signext i16 @minv(i16 signext %21, i32 %22)
%24 = tail call i32 @eval_8cards_fast(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %8, i32 %7)
%25 = tail call signext i16 @minv(i16 signext %23, i32 %24)
ret i16 %25
}