#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*/ die(char *);
double eval_double_arg(char *, double, double);
int eval_int_arg(char *, int, int);
void eval_args(int argc, char **argv, int *image_width, int *image_height,
               int *max_iterations, int *repetitions, double *center_x,
               double *center_y, double *height, char **colors,
               char **filename) {
  if (argc != 10)
    die("invalid number of arguments");
  *image_width = eval_int_arg(argv[1], 1, 100000);
  *image_height = eval_int_arg(argv[2], 1, 100000);
  *max_iterations = eval_int_arg(argv[3], 1, 1000000000);
  *repetitions = eval_int_arg(argv[4], 1, 1000000);
  *center_x = eval_double_arg(argv[5], -100.0, 100.0);
  *center_y = eval_double_arg(argv[6], -100.0, 100.0);
  *height = eval_double_arg(argv[7], -100.0, 100.0);
  *colors = argv[8];
  *filename = argv[9];
}


x86 assembly (clang, -O0):
<eval_args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
cmpl   $0xa,-0x4(%rbp)
je     1179 <eval_args+0x49>
lea    0xe9c(%rip),%rdi
call   1050 <die@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x1,%esi
mov    $0x186a0,%edx
call   1040 <eval_int_arg@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    $0x1,%esi
mov    $0x186a0,%edx
call   1040 <eval_int_arg@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
mov    $0x1,%esi
mov    $0x3b9aca00,%edx
call   1040 <eval_int_arg@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
mov    $0x1,%esi
mov    $0xf4240,%edx
call   1040 <eval_int_arg@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
movsd  0xdfb(%rip),%xmm0
movsd  0xdfb(%rip),%xmm1
call   1030 <eval_double_arg@plt>
mov    0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
mov    0x30(%rax),%rdi
movsd  0xdd6(%rip),%xmm0
movsd  0xdd6(%rip),%xmm1
call   1030 <eval_double_arg@plt>
mov    0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
mov    0x38(%rax),%rdi
movsd  0xdb1(%rip),%xmm0
movsd  0xdb1(%rip),%xmm1
call   1030 <eval_double_arg@plt>
mov    0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
mov    0x40(%rax),%rcx
mov    0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    0x48(%rax),%rcx
mov    0x30(%rbp),%rax
mov    %rcx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_args>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%r13
mov    %rsi,%rbx
mov    0x40(%rsp),%rbp
cmp    $0xa,%edi
je     1160 <eval_args+0x30>
lea    0xeb5(%rip),%rdi
call   1050 <die@plt>
mov    0x8(%rbx),%rdi
mov    $0x1,%esi
mov    $0x186a0,%edx
call   1040 <eval_int_arg@plt>
mov    %eax,0x0(%r13)
mov    0x10(%rbx),%rdi
mov    $0x1,%esi
mov    $0x186a0,%edx
call   1040 <eval_int_arg@plt>
mov    %eax,(%r12)
mov    0x18(%rbx),%rdi
mov    $0x1,%esi
mov    $0x3b9aca00,%edx
call   1040 <eval_int_arg@plt>
mov    %eax,(%r15)
mov    0x20(%rbx),%rdi
mov    $0x1,%esi
mov    $0xf4240,%edx
call   1040 <eval_int_arg@plt>
mov    %eax,(%r14)
mov    0x28(%rbx),%rdi
movsd  0xe3a(%rip),%xmm0
movsd  0xe3a(%rip),%xmm1
call   1030 <eval_double_arg@plt>
movsd  %xmm0,0x0(%rbp)
mov    0x30(%rbx),%rdi
movsd  0xe1c(%rip),%xmm0
movsd  0xe1c(%rip),%xmm1
call   1030 <eval_double_arg@plt>
mov    0x48(%rsp),%rax
movsd  %xmm0,(%rax)
mov    0x38(%rbx),%rdi
movsd  0xdfa(%rip),%xmm0
movsd  0xdfa(%rip),%xmm1
call   1030 <eval_double_arg@plt>
mov    0x50(%rsp),%rax
movsd  %xmm0,(%rax)
mov    0x40(%rbx),%rax
mov    0x58(%rsp),%rcx
mov    %rax,(%rcx)
mov    0x48(%rbx),%rax
mov    0x60(%rsp),%rcx
mov    %rax,(%rcx)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"invalid number of arguments\00"
define void @eval_args(i32 %0, i8** %1, i32* %2, i32* %3, i32* %4, i32* %5, double* %6, double* %7, double* %8, i8** %9, i8** %10) {
%12 = alloca i32
%13 = alloca i8**
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i32*
%18 = alloca double*
%19 = alloca double*
%20 = alloca double*
%21 = alloca i8**
%22 = alloca i8**
store i32 %0, i32* %12
store i8** %1, i8*** %13
store i32* %2, i32** %14
store i32* %3, i32** %15
store i32* %4, i32** %16
store i32* %5, i32** %17
store double* %6, double** %18
store double* %7, double** %19
store double* %8, double** %20
store i8** %9, i8*** %21
store i8** %10, i8*** %22
%23 = load i32, i32* %12
%24 = icmp ne i32 %23, 10
br i1 %24, label %25, label %27
25: ; preds = %11
%26 = call i32 @die(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %27
27: ; preds = %25, %11
%28 = load i8**, i8*** %13
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = call i32 @eval_int_arg(i8* %30, i32 1, i32 100000)
%32 = load i32*, i32** %14
store i32 %31, i32* %32
%33 = load i8**, i8*** %13
%34 = getelementptr inbounds i8*, i8** %33, i64 2
%35 = load i8*, i8** %34
%36 = call i32 @eval_int_arg(i8* %35, i32 1, i32 100000)
%37 = load i32*, i32** %15
store i32 %36, i32* %37
%38 = load i8**, i8*** %13
%39 = getelementptr inbounds i8*, i8** %38, i64 3
%40 = load i8*, i8** %39
%41 = call i32 @eval_int_arg(i8* %40, i32 1, i32 1000000000)
%42 = load i32*, i32** %16
store i32 %41, i32* %42
%43 = load i8**, i8*** %13
%44 = getelementptr inbounds i8*, i8** %43, i64 4
%45 = load i8*, i8** %44
%46 = call i32 @eval_int_arg(i8* %45, i32 1, i32 1000000)
%47 = load i32*, i32** %17
store i32 %46, i32* %47
%48 = load i8**, i8*** %13
%49 = getelementptr inbounds i8*, i8** %48, i64 5
%50 = load i8*, i8** %49
%51 = call double @eval_double_arg(i8* %50, double -1.000000e+02, double 1.000000e+02)
%52 = load double*, double** %18
store double %51, double* %52
%53 = load i8**, i8*** %13
%54 = getelementptr inbounds i8*, i8** %53, i64 6
%55 = load i8*, i8** %54
%56 = call double @eval_double_arg(i8* %55, double -1.000000e+02, double 1.000000e+02)
%57 = load double*, double** %19
store double %56, double* %57
%58 = load i8**, i8*** %13
%59 = getelementptr inbounds i8*, i8** %58, i64 7
%60 = load i8*, i8** %59
%61 = call double @eval_double_arg(i8* %60, double -1.000000e+02, double 1.000000e+02)
%62 = load double*, double** %20
store double %61, double* %62
%63 = load i8**, i8*** %13
%64 = getelementptr inbounds i8*, i8** %63, i64 8
%65 = load i8*, i8** %64
%66 = load i8**, i8*** %21
store i8* %65, i8** %66
%67 = load i8**, i8*** %13
%68 = getelementptr inbounds i8*, i8** %67, i64 9
%69 = load i8*, i8** %68
%70 = load i8**, i8*** %22
store i8* %69, i8** %70
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"invalid number of arguments\00"
define void @eval_args(i32 %0, i8** nocapture %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4, i32* nocapture writeonly %5, double* nocapture writeonly %6, double* nocapture writeonly %7, double* nocapture writeonly %8, i8** nocapture writeonly %9, i8** nocapture writeonly %10) {
%12 = icmp eq i32 %0, 10
br i1 %12, label %15, label %13
13: ; preds = %11
%14 = tail call i32 @die(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %11
%16 = getelementptr inbounds i8*, i8** %1, i64 1
%17 = load i8*, i8** %16
%18 = tail call i32 @eval_int_arg(i8* %17, i32 1, i32 100000)
store i32 %18, i32* %2
%19 = getelementptr inbounds i8*, i8** %1, i64 2
%20 = load i8*, i8** %19
%21 = tail call i32 @eval_int_arg(i8* %20, i32 1, i32 100000)
store i32 %21, i32* %3
%22 = getelementptr inbounds i8*, i8** %1, i64 3
%23 = load i8*, i8** %22
%24 = tail call i32 @eval_int_arg(i8* %23, i32 1, i32 1000000000)
store i32 %24, i32* %4
%25 = getelementptr inbounds i8*, i8** %1, i64 4
%26 = load i8*, i8** %25
%27 = tail call i32 @eval_int_arg(i8* %26, i32 1, i32 1000000)
store i32 %27, i32* %5
%28 = getelementptr inbounds i8*, i8** %1, i64 5
%29 = load i8*, i8** %28
%30 = tail call double @eval_double_arg(i8* %29, double -1.000000e+02, double 1.000000e+02)
store double %30, double* %6
%31 = getelementptr inbounds i8*, i8** %1, i64 6
%32 = load i8*, i8** %31
%33 = tail call double @eval_double_arg(i8* %32, double -1.000000e+02, double 1.000000e+02)
store double %33, double* %7
%34 = getelementptr inbounds i8*, i8** %1, i64 7
%35 = load i8*, i8** %34
%36 = tail call double @eval_double_arg(i8* %35, double -1.000000e+02, double 1.000000e+02)
store double %36, double* %8
%37 = getelementptr inbounds i8*, i8** %1, i64 8
%38 = load i8*, i8** %37
store i8* %38, i8** %9
%39 = getelementptr inbounds i8*, i8** %1, i64 9
%40 = load i8*, i8** %39
store i8* %40, i8** %10
ret void
}