#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*/ generator_render_no_locks(double, double, double, double,
                                             int /*<<< orphan*/,
                                             int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  double min_r, max_r, min_i, max_i;
  if (argc < 4) {
  help:
    puts("Usage: ./mand <threads> <cols-per-thread> <--locks|--no-locks>");
    exit(1);
  }
  min_r = -2;
  max_r = 1;
  min_i = -1;
  max_i = 1;
  if (strcmp("--locks", argv[3]) == 0) {
    generator_render(min_r, max_r, min_i, max_i, atoi(argv[1]), atoi(argv[2]));
  } else if (strcmp("--no-locks", argv[3]) == 0) {
    generator_render_no_locks(min_r, max_r, min_i, max_i, atoi(argv[1]),
                              atoi(argv[2]));
  } else {
    goto help;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    119e <main+0x3e>
jmp    1188 <main+0x28>
lea    0xe89(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
movsd  0xe6a(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe4d(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe48(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe33(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
lea    0xe76(%rip),%rdi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1258 <main+0xf8>
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   1070 <atoi@plt>
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1070 <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   1060 <generator_render@plt>
jmp    12e8 <main+0x188>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
lea    0xdf8(%rip),%rdi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    12de <main+0x17e>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x5c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1070 <atoi@plt>
movsd  -0x80(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm3
mov    -0x5c(%rbp),%edi
mov    %eax,%esi
call   1030 <generator_render_no_locks@plt>
jmp    12e3 <main+0x183>
jmp    1188 <main+0x28>
jmp    12e8 <main+0x188>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x3,%edi
jle    1214 <main+0xb4>
mov    %rsi,%rbx
mov    0x18(%rsi),%rsi
lea    0xedd(%rip),%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     11d3 <main+0x73>
mov    0x18(%rbx),%rsi
lea    0xed0(%rip),%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    1214 <main+0xb4>
mov    0x8(%rbx),%rdi
call   1070 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   1070 <atoi@plt>
movsd  0xe4b(%rip),%xmm0
movsd  0xe4b(%rip),%xmm2
movsd  0xe4b(%rip),%xmm1
movaps %xmm1,%xmm3
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <generator_render_no_locks@plt>
jmp    120b <main+0xab>
mov    0x8(%rbx),%rdi
call   1070 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   1070 <atoi@plt>
movsd  0xe11(%rip),%xmm0
movsd  0xe11(%rip),%xmm2
movsd  0xe11(%rip),%xmm1
movaps %xmm1,%xmm3
mov    %ebp,%edi
mov    %eax,%esi
call   1060 <generator_render@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xdfd(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [63 x i8] c"Usage: ./mand <threads> <cols-per-thread> <--locks|--no-locks>\00"
@.str.1 = [8 x i8] c"--locks\00"
@.str.2 = [11 x i8] c"--no-locks\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, 4
br i1 %11, label %12, label %16
12: ; preds = %2
br label %13
13: ; preds = %56, %12
%14 = call i32 @puts(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @exit(i32 1)
unreachable
16: ; 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
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 3
%19 = load i8*, i8** %18
%20 = call i64 @strcmp(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %19)
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %36
22: ; preds = %16
%23 = load double, double* %6
%24 = load double, double* %7
%25 = load double, double* %8
%26 = load double, double* %9
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = call i32 @atoi(i8* %29)
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 2
%33 = load i8*, i8** %32
%34 = call i32 @atoi(i8* %33)
%35 = call i32 @generator_render(double %23, double %24, double %25, double %26, i32 %30, i32 %34)
br label %58
36: ; preds = %16
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 3
%39 = load i8*, i8** %38
%40 = call i64 @strcmp(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %39)
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %56
42: ; preds = %36
%43 = load double, double* %6
%44 = load double, double* %7
%45 = load double, double* %8
%46 = load double, double* %9
%47 = load i8**, i8*** %5
%48 = getelementptr inbounds i8*, i8** %47, i64 1
%49 = load i8*, i8** %48
%50 = call i32 @atoi(i8* %49)
%51 = load i8**, i8*** %5
%52 = getelementptr inbounds i8*, i8** %51, i64 2
%53 = load i8*, i8** %52
%54 = call i32 @atoi(i8* %53)
%55 = call i32 @generator_render_no_locks(double %43, double %44, double %45, double %46, i32 %50, i32 %54)
br label %57
56: ; preds = %36
br label %13
57: ; preds = %42
br label %58
58: ; preds = %57, %22
ret i32 0
}

LLVM IR (-O2):
@.str = [63 x i8] c"Usage: ./mand <threads> <cols-per-thread> <--locks|--no-locks>\00"
@.str.1 = [8 x i8] c"--locks\00"
@.str.2 = [11 x i8] c"--no-locks\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 4
br i1 %3, label %4, label %7
4: ; preds = %20, %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 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 3
%9 = load i8*, i8** %8
%10 = tail call i64 @strcmp(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %7
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = tail call i32 @atoi(i8* %14)
%16 = getelementptr inbounds i8*, i8** %1, i64 2
%17 = load i8*, i8** %16
%18 = tail call i32 @atoi(i8* %17)
%19 = tail call i32 @generator_render(double -2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 1.000000e+00, i32 %15, i32 %18)
br label %32
20: ; preds = %7
%21 = load i8*, i8** %8
%22 = tail call i64 @strcmp(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %21)
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %4
24: ; preds = %20
%25 = getelementptr inbounds i8*, i8** %1, i64 1
%26 = load i8*, i8** %25
%27 = tail call i32 @atoi(i8* %26)
%28 = getelementptr inbounds i8*, i8** %1, i64 2
%29 = load i8*, i8** %28
%30 = tail call i32 @atoi(i8* %29)
%31 = tail call i32 @generator_render_no_locks(double -2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 1.000000e+00, i32 %27, i32 %30)
br label %32
32: ; preds = %24, %12
ret i32 0
}