#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*/ atoi(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ generator_render(double, double, double, double,
                                    int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  double min_r, max_r, min_i, max_i;
  if (argc < 3) {
    puts("Usage: ./mandelbrot-parallel number-of-threads "
         "number-of-columns-per-thread");
    exit(1);
  }
  min_r = -2;
  max_r = 1;
  min_i = -1;
  max_i = 1;
  generator_render(min_r, max_r, min_i, max_i, atoi(argv[1]), atoi(argv[2]));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1176 <main+0x36>
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
movsd  0xe92(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe75(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe70(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe5b(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atoi@plt>
movsd  -0x58(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm3
mov    -0x34(%rbp),%edi
mov    %eax,%esi
call   1040 <generator_render@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x2,%edi
jle    118c <main+0x4c>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   1050 <atoi@plt>
movsd  0xe99(%rip),%xmm0
movsd  0xe99(%rip),%xmm2
movsd  0xe99(%rip),%xmm1
movaps %xmm1,%xmm3
mov    %ebp,%edi
mov    %eax,%esi
call   1040 <generator_render@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe85(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [76 x i8] c"Usage: ./mandelbrot-parallel number-of-threads number-of-columns-per-thread\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 3
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = call i32 @puts(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
store double -2.000000e+00, double* %6
store double 1.000000e+00, double* %7
store double -1.000000e+00, double* %8
store double 1.000000e+00, double* %9
%16 = load double, double* %6
%17 = load double, double* %7
%18 = load double, double* %8
%19 = load double, double* %9
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i32 @atoi(i8* %22)
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 2
%26 = load i8*, i8** %25
%27 = call i32 @atoi(i8* %26)
%28 = call i32 @generator_render(double %16, double %17, double %18, double %19, i32 %23, i32 %27)
ret i32 0
}

LLVM IR (-O2):
@.str = [76 x i8] c"Usage: ./mandelbrot-parallel number-of-threads number-of-columns-per-thread\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @atoi(i8* %9)
%11 = getelementptr inbounds i8*, i8** %1, i64 2
%12 = load i8*, i8** %11
%13 = tail call i32 @atoi(i8* %12)
%14 = tail call i32 @generator_render(double -2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 1.000000e+00, i32 %10, i32 %13)
ret i32 0
}