#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*/ EXIT_FAILURE;
long atol(char *);
int /*<<< orphan*/ evaluate(long, long, long);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ usage(char *);
int main(int argc, char **argv) {
  long int i = 0;
  if (argc != 4) {
    usage(argv[0]);
    exit(EXIT_FAILURE);
  }
  long int len = atol(argv[1]);
  long int round = atol(argv[2]);
  long int case_no = atol(argv[3]);
  if ((case_no < 1) || (case_no > 7)) {
    usage(argv[0]);
    exit(EXIT_FAILURE);
  }
  evaluate(len, round, case_no);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpl   $0x4,-0x4(%rbp)
je     117b <main+0x3b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <usage@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atol@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atol@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1050 <atol@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x1,-0x30(%rbp)
jl     11c4 <main+0x84>
cmpq   $0x7,-0x30(%rbp)
jle    11de <main+0x9e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <usage@plt>
mov    0x2e09(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1030 <evaluate@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
cmp    $0x4,%edi
jne    118e <main+0x4e>
mov    0x18(%rbx),%rdi
call   1050 <atol@plt>
mov    %rax,%r14
add    $0xfffffffffffffff8,%rax
cmp    $0xfffffffffffffff8,%rax
jbe    118e <main+0x4e>
mov    0x10(%rbx),%rdi
call   1050 <atol@plt>
mov    %rax,%r15
mov    0x8(%rbx),%rdi
call   1050 <atol@plt>
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <evaluate@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
mov    (%rbx),%rdi
call   1040 <usage@plt>
mov    0x2e43(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i64 0, i64* %5
%9 = load i32, i32* %3
%10 = icmp ne i32 %9, 4
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i8**, i8*** %4
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i32 @usage(i8* %14)
%16 = load i32, i32* @EXIT_FAILURE
%17 = call i32 @exit(i32 %16)
unreachable
18: ; preds = %2
%19 = load i8**, i8*** %4
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i64 @atol(i8* %21)
store i64 %22, i64* %6
%23 = load i8**, i8*** %4
%24 = getelementptr inbounds i8*, i8** %23, i64 2
%25 = load i8*, i8** %24
%26 = call i64 @atol(i8* %25)
store i64 %26, i64* %7
%27 = load i8**, i8*** %4
%28 = getelementptr inbounds i8*, i8** %27, i64 3
%29 = load i8*, i8** %28
%30 = call i64 @atol(i8* %29)
store i64 %30, i64* %8
%31 = load i64, i64* %8
%32 = icmp slt i64 %31, 1
br i1 %32, label %36, label %33
33: ; preds = %18
%34 = load i64, i64* %8
%35 = icmp sgt i64 %34, 7
br i1 %35, label %36, label %43
36: ; preds = %33, %18
%37 = load i8**, i8*** %4
%38 = getelementptr inbounds i8*, i8** %37, i64 0
%39 = load i8*, i8** %38
%40 = call i32 @usage(i8* %39)
%41 = load i32, i32* @EXIT_FAILURE
%42 = call i32 @exit(i32 %41)
unreachable
43: ; preds = %33
%44 = load i64, i64* %6
%45 = load i64, i64* %7
%46 = load i64, i64* %8
%47 = call i32 @evaluate(i64 %44, i64 %45, i64 %46)
ret i32 0
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 4
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @usage(i8* %5)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 3
%11 = load i8*, i8** %10
%12 = tail call i64 @atol(i8* %11)
%13 = add i64 %12, -8
%14 = icmp ult i64 %13, -7
br i1 %14, label %15, label %20
15: ; preds = %9
%16 = load i8*, i8** %1
%17 = tail call i32 @usage(i8* %16)
%18 = load i32, i32* @EXIT_FAILURE
%19 = tail call i32 @exit(i32 %18)
unreachable
20: ; preds = %9
%21 = getelementptr inbounds i8*, i8** %1, i64 2
%22 = load i8*, i8** %21
%23 = tail call i64 @atol(i8* %22)
%24 = getelementptr inbounds i8*, i8** %1, i64 1
%25 = load i8*, i8** %24
%26 = tail call i64 @atol(i8* %25)
%27 = tail call i32 @evaluate(i64 %26, i64 %23, i64 %12)
ret i32 0
}