#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 */
float atof(int /*<<< orphan*/);
int atoi(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int getopt(int, char **, char *);
int /*<<< orphan*/ optarg;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
void read_options(int argc, char **argv, int *gridSizeX, int *gridSizeY,
                  int *iter, float *xMin, float *xMax, float *yMin,
                  float *yMax) {
  int count;
  int tmp;
  float ftmp;
  *gridSizeX = 768;
  *xMin = (-2.0);
  *xMax = (1.0);
  *yMin = (-1.2);
  *yMax = (1.2);
  *iter = 5000;
  while ((count = getopt(argc, argv, "s:S:i:x:X:y:Y:mjh")) != -1) {
    switch (count) {
    case 'S':
      tmp = atoi(optarg);
      if (tmp >= 4)
        *gridSizeX = tmp;
      else
        fprintf(stderr, "Using default grid size.\n");
      break;
    case 'i':
      tmp = atoi(optarg);
      if (tmp > 0)
        *iter = tmp;
      else
        fprintf(stderr, "Using default number of iterations.\n");
      break;
    case 'x':
      ftmp = atof(optarg);
      *xMin = ftmp;
      break;
    case 'X':
      ftmp = atof(optarg);
      *xMax = ftmp;
      break;
    case 'y':
      ftmp = atof(optarg);
      *yMin = ftmp;
      break;
    case 'Y':
      ftmp = atof(optarg);
      *yMax = ftmp;
      break;
    case '?':
    case 'h':
      printf("Usage:\n");
      printf("mandelbrot [-SixXyYh]\n");
      printf("   -S NPIXEL    Set number of pixels in X dimension of image\n");
      printf("                Y dimension is scaled to ensure pixels are "
             "square\n");
      printf("   -i ITS       Set max number of iterations for a point to be "
             "inside\n");
      printf("   -x XMIN      Set xmin coordinate\n");
      printf("   -X XMAX      Set xmax coordinate\n");
      printf("   -y YMIN      Set ymin coordinate\n");
      printf("   -Y YMAX      Set ymax coordinate\n");
      printf("   -h           Show this help\n");
      exit(-1);
    }
  }
  if (*xMin >= *xMax) {
    fprintf(stderr, "WARNING: xMin has to be smaller than xMax.\n Reassign "
                    "default values.\n");
    *xMin = (-2.0);
    *xMax = (1.0);
  }
  if (*yMin >= *yMax) {
    fprintf(stderr, "WARNING: yMin has to be smaller than yMax.\n Reassign "
                    "default values.\n");
    *yMin = (-1.2);
    *yMax = (1.2);
  }
  *gridSizeY = (int)(*gridSizeX * (*yMax - *yMin) / (*xMax - *xMin));
}


x86 assembly (clang, -O0):
<read_options>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
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)
mov    -0x18(%rbp),%rax
movl   $0x300,(%rax)
mov    -0x30(%rbp),%rax
movss  0xe6b(%rip),%xmm0
movss  %xmm0,(%rax)
mov    0x10(%rbp),%rax
movss  0xe57(%rip),%xmm0
movss  %xmm0,(%rax)
mov    0x18(%rbp),%rax
movss  0xe43(%rip),%xmm0
movss  %xmm0,(%rax)
mov    0x20(%rbp),%rax
movss  0xe2f(%rip),%xmm0
movss  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
movl   $0x1388,(%rax)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xf0f(%rip),%rdx
call   1060 <getopt@plt>
mov    %eax,-0x34(%rbp)
cmp    $0xffffffff,%eax
je     13c8 <read_options+0x268>
mov    -0x34(%rbp),%eax
add    $0xffffffc1,%eax
mov    %eax,%ecx
mov    %rcx,-0x48(%rbp)
sub    $0x3a,%eax
ja     13c3 <read_options+0x263>
mov    -0x48(%rbp),%rax
lea    0xdf2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2dca(%rip),%rax
mov    (%rax),%edi
call   1070 <atoi@plt>
mov    %eax,-0x38(%rbp)
cmpl   $0x4,-0x38(%rbp)
jl     1250 <read_options+0xf0>
mov    -0x38(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
jmp    1265 <read_options+0x105>
mov    0x2d81(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
call   1050 <fprintf@plt>
jmp    13c3 <read_options+0x263>
mov    0x2d87(%rip),%rax
mov    (%rax),%edi
call   1070 <atoi@plt>
mov    %eax,-0x38(%rbp)
cmpl   $0x0,-0x38(%rbp)
jle    1293 <read_options+0x133>
mov    -0x38(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
jmp    12a8 <read_options+0x148>
mov    0x2d3e(%rip),%rax
mov    (%rax),%edi
lea    0xe85(%rip),%rsi
call   1050 <fprintf@plt>
jmp    13c3 <read_options+0x263>
mov    0x2d44(%rip),%rax
mov    (%rax),%edi
call   1030 <atof@plt>
movss  %xmm0,-0x3c(%rbp)
movss  -0x3c(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movss  %xmm0,(%rax)
jmp    13c3 <read_options+0x263>
mov    0x2d1f(%rip),%rax
mov    (%rax),%edi
call   1030 <atof@plt>
movss  %xmm0,-0x3c(%rbp)
movss  -0x3c(%rbp),%xmm0
mov    0x10(%rbp),%rax
movss  %xmm0,(%rax)
jmp    13c3 <read_options+0x263>
mov    0x2cfa(%rip),%rax
mov    (%rax),%edi
call   1030 <atof@plt>
movss  %xmm0,-0x3c(%rbp)
movss  -0x3c(%rbp),%xmm0
mov    0x18(%rbp),%rax
movss  %xmm0,(%rax)
jmp    13c3 <read_options+0x263>
mov    0x2cd5(%rip),%rax
mov    (%rax),%edi
call   1030 <atof@plt>
movss  %xmm0,-0x3c(%rbp)
movss  -0x3c(%rbp),%xmm0
mov    0x20(%rbp),%rax
movss  %xmm0,(%rax)
jmp    13c3 <read_options+0x263>
lea    0xe05(%rip),%rdi
call   1040 <printf@plt>
lea    0xe01(%rip),%rdi
call   1040 <printf@plt>
lea    0xe0c(%rip),%rdi
call   1040 <printf@plt>
lea    0xe3e(%rip),%rdi
call   1040 <printf@plt>
lea    0xe75(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
lea    0xee2(%rip),%rdi
call   1040 <printf@plt>
lea    0xefb(%rip),%rdi
call   1040 <printf@plt>
lea    0xf14(%rip),%rdi
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1080 <exit@plt>
jmp    11df <read_options+0x7f>
mov    -0x30(%rbp),%rax
movss  (%rax),%xmm0
mov    0x10(%rbp),%rax
ucomiss (%rax),%xmm0
jb     1412 <read_options+0x2b2>
mov    0x2bf4(%rip),%rax
mov    (%rax),%edi
lea    0xefb(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x30(%rbp),%rax
movss  0xc0e(%rip),%xmm0
movss  %xmm0,(%rax)
mov    0x10(%rbp),%rax
movss  0xbfa(%rip),%xmm0
movss  %xmm0,(%rax)
mov    0x18(%rbp),%rax
movss  (%rax),%xmm0
mov    0x20(%rbp),%rax
ucomiss (%rax),%xmm0
jb     145c <read_options+0x2fc>
mov    0x2baa(%rip),%rax
mov    (%rax),%edi
lea    0xef7(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x18(%rbp),%rax
movss  0xbbc(%rip),%xmm0
movss  %xmm0,(%rax)
mov    0x20(%rbp),%rax
movss  0xba8(%rip),%xmm0
movss  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
cvtsi2ssl (%rax),%xmm0
mov    0x20(%rbp),%rax
movss  (%rax),%xmm1
mov    0x18(%rbp),%rax
subss  (%rax),%xmm1
mulss  %xmm1,%xmm0
mov    0x10(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x30(%rbp),%rax
subss  (%rax),%xmm1
divss  %xmm1,%xmm0
cvttss2si %xmm0,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_options>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,%r13
mov    %rcx,0x8(%rsp)
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x60(%rsp),%rsi
mov    0x58(%rsp),%rcx
mov    0x50(%rsp),%rax
mov    %rdx,(%rsp)
movl   $0x300,(%rdx)
movl   $0xc0000000,(%r9)
movl   $0x3f800000,(%rax)
movl   $0xbf99999a,(%rcx)
movl   $0x3f99999a,(%rsi)
mov    %r8,0x10(%rsp)
movl   $0x1388,(%r8)
lea    0xf34(%rip),%r14
lea    0xe41(%rip),%r15
mov    0x2e2a(%rip),%r12
jmp    11f0 <read_options+0x90>
mov    (%r12),%edi
call   1040 <atof@plt>
mov    0x60(%rsp),%rax
movss  %xmm0,(%rax)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1060 <getopt@plt>
lea    -0x3f(%rax),%ecx
cmp    $0x3a,%ecx
ja     1276 <read_options+0x116>
movslq (%r15,%rcx,4),%rax
add    %r15,%rax
jmp    *%rax
mov    (%r12),%edi
call   1070 <atoi@plt>
cmp    $0x4,%eax
jl     1281 <read_options+0x121>
mov    (%rsp),%rcx
mov    %eax,(%rcx)
jmp    11f0 <read_options+0x90>
mov    (%r12),%edi
call   1040 <atof@plt>
mov    0x50(%rsp),%rax
movss  %xmm0,(%rax)
jmp    11f0 <read_options+0x90>
mov    (%r12),%edi
call   1070 <atoi@plt>
test   %eax,%eax
jle    129b <read_options+0x13b>
mov    0x10(%rsp),%rcx
mov    %eax,(%rcx)
jmp    11f0 <read_options+0x90>
mov    (%r12),%edi
call   1040 <atof@plt>
movss  %xmm0,0x0(%r13)
jmp    11f0 <read_options+0x90>
mov    (%r12),%edi
call   1040 <atof@plt>
mov    0x58(%rsp),%rax
movss  %xmm0,(%rax)
jmp    11f0 <read_options+0x90>
cmp    $0xffffffff,%eax
jne    11f0 <read_options+0x90>
jmp    12b5 <read_options+0x155>
mov    0x2d50(%rip),%rax
mov    (%rax),%edi
lea    0xe75(%rip),%rsi
call   1050 <fprintf@plt>
jmp    11f0 <read_options+0x90>
mov    0x2d36(%rip),%rax
mov    (%rax),%edi
lea    0xe75(%rip),%rsi
call   1050 <fprintf@plt>
jmp    11f0 <read_options+0x90>
movss  0x0(%r13),%xmm1
mov    0x50(%rsp),%rax
movss  (%rax),%xmm0
ucomiss %xmm0,%xmm1
jb     12f9 <read_options+0x199>
mov    0x2d08(%rip),%rax
mov    (%rax),%edi
lea    0xe6c(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0xc0000000,0x0(%r13)
c0
mov    0x50(%rsp),%rax
movl   $0x3f800000,(%rax)
movss  0xd07(%rip),%xmm0
mov    0x58(%rsp),%rbx
movss  (%rbx),%xmm1
mov    0x60(%rsp),%rbp
movss  0x0(%rbp),%xmm2
ucomiss %xmm2,%xmm1
jb     1348 <read_options+0x1e8>
mov    0x2cc0(%rip),%rax
mov    (%rax),%edi
lea    0xe6a(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0xbf99999a,(%rbx)
movl   $0x3f99999a,0x0(%rbp)
movss  (%rbx),%xmm1
mov    0x50(%rsp),%rax
movss  (%rax),%xmm0
movss  0xcbc(%rip),%xmm2
mov    (%rsp),%rax
cvtsi2ssl (%rax),%xmm3
subss  %xmm1,%xmm2
mulss  %xmm2,%xmm3
subss  0x0(%r13),%xmm0
divss  %xmm0,%xmm3
cvttss2si %xmm3,%eax
mov    0x8(%rsp),%rcx
mov    %eax,(%rcx)
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe4e(%rip),%rdi
call   1030 <puts@plt>
lea    0xe49(%rip),%rdi
call   1030 <puts@plt>
lea    0xe53(%rip),%rdi
call   1030 <puts@plt>
lea    0xe84(%rip),%rdi
call   1030 <puts@plt>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
lea    0xef4(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0c(%rip),%rdi
call   1030 <puts@plt>
lea    0xf24(%rip),%rdi
call   1030 <puts@plt>
lea    0xf3c(%rip),%rdi
call   1030 <puts@plt>
lea    0xf54(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"s:S:i:x:X:y:Y:mjh\00"
@optarg = global i32 0
@stderr = global i32 0
@.str.1 = [26 x i8] c"Using default grid size.\0A\00"
@.str.2 = [37 x i8] c"Using default number of iterations.\0A\00"
@.str.3 = [8 x i8] c"Usage:\0A\00"
@.str.4 = [23 x i8] c"mandelbrot [-SixXyYh]\0A\00"
@.str.5 = [62 x i8] c" -S NPIXEL Set number of pixels in X dimension of image\0A\00"
@.str.6 = [67 x i8] c" Y dimension is scaled to ensure pixels are square\0A\00"
@.str.7 = [71 x i8] c" -i ITS Set max number of iterations for a point to be inside\0A\00"
@.str.8 = [37 x i8] c" -x XMIN Set xmin coordinate\0A\00"
@.str.9 = [37 x i8] c" -X XMAX Set xmax coordinate\0A\00"
@.str.10 = [37 x i8] c" -y YMIN Set ymin coordinate\0A\00"
@.str.11 = [37 x i8] c" -Y YMAX Set ymax coordinate\0A\00"
@.str.12 = [32 x i8] c" -h Show this help\0A\00"
@.str.13 = [70 x i8] c"WARNING: xMin has to be smaller than xMax.\0A Reassign default values.\0A\00"
@.str.14 = [70 x i8] c"WARNING: yMin has to be smaller than yMax.\0A Reassign default values.\0A\00"
define void @read_options(i32 %0, i8** %1, i32* %2, i32* %3, i32* %4, float* %5, float* %6, float* %7, float* %8) {
%10 = alloca i32
%11 = alloca i8**
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca float*
%16 = alloca float*
%17 = alloca float*
%18 = alloca float*
%19 = alloca i32
%20 = alloca i32
%21 = alloca float
store i32 %0, i32* %10
store i8** %1, i8*** %11
store i32* %2, i32** %12
store i32* %3, i32** %13
store i32* %4, i32** %14
store float* %5, float** %15
store float* %6, float** %16
store float* %7, float** %17
store float* %8, float** %18
%22 = load i32*, i32** %12
store i32 768, i32* %22
%23 = load float*, float** %15
store float -2.000000e+00, float* %23
%24 = load float*, float** %16
store float 1.000000e+00, float* %24
%25 = load float*, float** %17
store float 0xBFF3333340000000, float* %25
%26 = load float*, float** %18
store float 0x3FF3333340000000, float* %26
%27 = load i32*, i32** %14
store i32 5000, i32* %27
br label %28
28: ; preds = %91, %9
%29 = load i32, i32* %10
%30 = load i8**, i8*** %11
%31 = call i32 @getopt(i32 %29, i8** %30, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store i32 %31, i32* %19
%32 = icmp ne i32 %31, -1
br i1 %32, label %33, label %92
33: ; preds = %28
%34 = load i32, i32* %19
switch i32 %34, label %91 [
i32 83, label %35
i32 105, label %47
i32 120, label %59
i32 88, label %64
i32 121, label %69
i32 89, label %74
i32 63, label %79
i32 104, label %79
]
35: ; preds = %33
%36 = load i32, i32* @optarg
%37 = call i32 @atoi(i32 %36)
store i32 %37, i32* %20
%38 = load i32, i32* %20
%39 = icmp sge i32 %38, 4
br i1 %39, label %40, label %43
40: ; preds = %35
%41 = load i32, i32* %20
%42 = load i32*, i32** %12
store i32 %41, i32* %42
br label %46
43: ; preds = %35
%44 = load i32, i32* @stderr
%45 = call i32 @fprintf(i32 %44, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
br label %46
46: ; preds = %43, %40
br label %91
47: ; preds = %33
%48 = load i32, i32* @optarg
%49 = call i32 @atoi(i32 %48)
store i32 %49, i32* %20
%50 = load i32, i32* %20
%51 = icmp sgt i32 %50, 0
br i1 %51, label %52, label %55
52: ; preds = %47
%53 = load i32, i32* %20
%54 = load i32*, i32** %14
store i32 %53, i32* %54
br label %58
55: ; preds = %47
%56 = load i32, i32* @stderr
%57 = call i32 @fprintf(i32 %56, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
br label %58
58: ; preds = %55, %52
br label %91
59: ; preds = %33
%60 = load i32, i32* @optarg
%61 = call float @atof(i32 %60)
store float %61, float* %21
%62 = load float, float* %21
%63 = load float*, float** %15
store float %62, float* %63
br label %91
64: ; preds = %33
%65 = load i32, i32* @optarg
%66 = call float @atof(i32 %65)
store float %66, float* %21
%67 = load float, float* %21
%68 = load float*, float** %16
store float %67, float* %68
br label %91
69: ; preds = %33
%70 = load i32, i32* @optarg
%71 = call float @atof(i32 %70)
store float %71, float* %21
%72 = load float, float* %21
%73 = load float*, float** %17
store float %72, float* %73
br label %91
74: ; preds = %33
%75 = load i32, i32* @optarg
%76 = call float @atof(i32 %75)
store float %76, float* %21
%77 = load float, float* %21
%78 = load float*, float** %18
store float %77, float* %78
br label %91
79: ; preds = %33, %33
%80 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%81 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
%82 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.5, i64 0, i64 0))
%83 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.6, i64 0, i64 0))
%84 = call i32 @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.7, i64 0, i64 0))
%85 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0))
%86 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.9, i64 0, i64 0))
%87 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0))
%88 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.11, i64 0, i64 0))
%89 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.12, i64 0, i64 0))
%90 = call i32 @exit(i32 -1)
unreachable
91: ; preds = %33, %74, %69, %64, %59, %58, %46
br label %28
92: ; preds = %28
%93 = load float*, float** %15
%94 = load float, float* %93
%95 = load float*, float** %16
%96 = load float, float* %95
%97 = fcmp oge float %94, %96
br i1 %97, label %98, label %103
98: ; preds = %92
%99 = load i32, i32* @stderr
%100 = call i32 @fprintf(i32 %99, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.13, i64 0, i64 0))
%101 = load float*, float** %15
store float -2.000000e+00, float* %101
%102 = load float*, float** %16
store float 1.000000e+00, float* %102
br label %103
103: ; preds = %98, %92
%104 = load float*, float** %17
%105 = load float, float* %104
%106 = load float*, float** %18
%107 = load float, float* %106
%108 = fcmp oge float %105, %107
br i1 %108, label %109, label %114
109: ; preds = %103
%110 = load i32, i32* @stderr
%111 = call i32 @fprintf(i32 %110, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.14, i64 0, i64 0))
%112 = load float*, float** %17
store float 0xBFF3333340000000, float* %112
%113 = load float*, float** %18
store float 0x3FF3333340000000, float* %113
br label %114
114: ; preds = %109, %103
%115 = load i32*, i32** %12
%116 = load i32, i32* %115
%117 = sitofp i32 %116 to float
%118 = load float*, float** %18
%119 = load float, float* %118
%120 = load float*, float** %17
%121 = load float, float* %120
%122 = fsub float %119, %121
%123 = fmul float %117, %122
%124 = load float*, float** %16
%125 = load float, float* %124
%126 = load float*, float** %15
%127 = load float, float* %126
%128 = fsub float %125, %127
%129 = fdiv float %123, %128
%130 = fptosi float %129 to i32
%131 = load i32*, i32** %13
store i32 %130, i32* %131
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"s:S:i:x:X:y:Y:mjh\00"
@optarg = global i32 0
@stderr = global i32 0
@.str.1 = [26 x i8] c"Using default grid size.\0A\00"
@.str.2 = [37 x i8] c"Using default number of iterations.\0A\00"
@.str.13 = [70 x i8] c"WARNING: xMin has to be smaller than xMax.\0A Reassign default values.\0A\00"
@.str.14 = [70 x i8] c"WARNING: yMin has to be smaller than yMax.\0A Reassign default values.\0A\00"
@str = [7 x i8] c"Usage:\00"
@str.15 = [22 x i8] c"mandelbrot [-SixXyYh]\00"
@str.16 = [61 x i8] c" -S NPIXEL Set number of pixels in X dimension of image\00"
@str.17 = [66 x i8] c" Y dimension is scaled to ensure pixels are square\00"
@str.18 = [70 x i8] c" -i ITS Set max number of iterations for a point to be inside\00"
@str.19 = [36 x i8] c" -x XMIN Set xmin coordinate\00"
@str.20 = [36 x i8] c" -X XMAX Set xmax coordinate\00"
@str.21 = [36 x i8] c" -y YMIN Set ymin coordinate\00"
@str.22 = [36 x i8] c" -Y YMAX Set ymax coordinate\00"
@str.23 = [31 x i8] c" -h Show this help\00"
define void @read_options(i32 %0, i8** %1, i32* nocapture %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4, float* nocapture %5, float* nocapture %6, float* nocapture %7, float* nocapture %8) {
store i32 768, i32* %2
store float -2.000000e+00, float* %5
store float 1.000000e+00, float* %6
store float 0xBFF3333340000000, float* %7
store float 0x3FF3333340000000, float* %8
store i32 5000, i32* %4
br label %10
10: ; preds = %12, %9
%11 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
switch i32 %11, label %12 [
i32 -1, label %53
i32 83, label %13
i32 105, label %21
i32 120, label %29
i32 88, label %32
i32 121, label %35
i32 89, label %38
i32 63, label %41
i32 104, label %41
]
12: ; preds = %10, %25, %26, %17, %18, %38, %35, %32, %29
br label %10
13: ; preds = %10
%14 = load i32, i32* @optarg
%15 = tail call i32 @atoi(i32 %14)
%16 = icmp sgt i32 %15, 3
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 %15, i32* %2
br label %12
18: ; preds = %13
%19 = load i32, i32* @stderr
%20 = tail call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
br label %12
21: ; preds = %10
%22 = load i32, i32* @optarg
%23 = tail call i32 @atoi(i32 %22)
%24 = icmp sgt i32 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %21
store i32 %23, i32* %4
br label %12
26: ; preds = %21
%27 = load i32, i32* @stderr
%28 = tail call i32 @fprintf(i32 %27, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
br label %12
29: ; preds = %10
%30 = load i32, i32* @optarg
%31 = tail call float @atof(i32 %30)
store float %31, float* %5
br label %12
32: ; preds = %10
%33 = load i32, i32* @optarg
%34 = tail call float @atof(i32 %33)
store float %34, float* %6
br label %12
35: ; preds = %10
%36 = load i32, i32* @optarg
%37 = tail call float @atof(i32 %36)
store float %37, float* %7
br label %12
38: ; preds = %10
%39 = load i32, i32* @optarg
%40 = tail call float @atof(i32 %39)
store float %40, float* %8
br label %12
41: ; preds = %10, %10
%42 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%43 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.15, i64 0, i64 0))
%44 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.16, i64 0, i64 0))
%45 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.17, i64 0, i64 0))
%46 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @str.18, i64 0, i64 0))
%47 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.19, i64 0, i64 0))
%48 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.20, i64 0, i64 0))
%49 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.21, i64 0, i64 0))
%50 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.22, i64 0, i64 0))
%51 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.23, i64 0, i64 0))
%52 = tail call i32 @exit(i32 -1)
unreachable
53: ; preds = %10
%54 = load float, float* %5
%55 = load float, float* %6
%56 = fcmp ult float %54, %55
br i1 %56, label %60, label %57
57: ; preds = %53
%58 = load i32, i32* @stderr
%59 = tail call i32 @fprintf(i32 %58, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.13, i64 0, i64 0))
store float -2.000000e+00, float* %5
store float 1.000000e+00, float* %6
br label %60
60: ; preds = %57, %53
%61 = phi float [ 1.000000e+00, %57 ], [ %55, %53 ]
%62 = load float, float* %7
%63 = load float, float* %8
%64 = fcmp ult float %62, %63
br i1 %64, label %70, label %65
65: ; preds = %60
%66 = load i32, i32* @stderr
%67 = tail call i32 @fprintf(i32 %66, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.14, i64 0, i64 0))
store float 0xBFF3333340000000, float* %7
store float 0x3FF3333340000000, float* %8
%68 = load float, float* %7
%69 = load float, float* %6
br label %70
70: ; preds = %65, %60
%71 = phi float [ %69, %65 ], [ %61, %60 ]
%72 = phi float [ %68, %65 ], [ %62, %60 ]
%73 = phi float [ 0x3FF3333340000000, %65 ], [ %63, %60 ]
%74 = load i32, i32* %2
%75 = sitofp i32 %74 to float
%76 = fsub float %73, %72
%77 = fmul float %76, %75
%78 = load float, float* %5
%79 = fsub float %71, %78
%80 = fdiv float %77, %79
%81 = fptosi float %80 to i32
store i32 %81, i32* %3
ret void
}