#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 */
double atof(int /*<<< orphan*/);
int atoi(int /*<<< orphan*/);
int getopt(int, char **, char *);
int /*<<< orphan*/ optarg;
int parseArguments(int argc, char **argv, int *timeSteps, bool *printSteps,
                   int *width, int *height, double *temp, bool *color,
                   int *delay) {
  int c;
  while ((c = getopt(argc, argv, "s:t:w:h:pcd:")) != -1) {
    switch (c) {
    case 's': {
      *timeSteps = atoi(optarg);
      break;
    }
    case 't': {
      *temp = atof(optarg);
      break;
    }
    case 'w': {
      *width = atoi(optarg);
      break;
    }
    case 'h': {
      *height = atoi(optarg);
      break;
    }
    case 'p': {
      *printSteps = true;
      break;
    }
    case 'c': {
      *color = true;
      break;
    }
    case 'd': {
      *delay = atoi(optarg) * 1000000;
      break;
    }
    default: {
      return 1;
    }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<parseArguments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xeeb(%rip),%rdx
call   1040 <getopt@plt>
mov    %eax,-0x34(%rbp)
cmp    $0xffffffff,%eax
je     125d <parseArguments+0x12d>
mov    -0x34(%rbp),%eax
add    $0xffffff9d,%eax
mov    %eax,%ecx
mov    %rcx,-0x40(%rbp)
sub    $0x14,%eax
ja     124c <parseArguments+0x11c>
mov    -0x40(%rbp),%rax
lea    0xe66(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2e4e(%rip),%rax
mov    (%rax),%edi
call   1050 <atoi@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
jmp    1258 <parseArguments+0x128>
mov    0x2e33(%rip),%rax
mov    (%rax),%edi
call   1030 <atof@plt>
mov    0x10(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1258 <parseArguments+0x128>
mov    0x2e18(%rip),%rax
mov    (%rax),%edi
call   1050 <atoi@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
jmp    1258 <parseArguments+0x128>
mov    0x2dfd(%rip),%rax
mov    (%rax),%edi
call   1050 <atoi@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
jmp    1258 <parseArguments+0x128>
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
jmp    1258 <parseArguments+0x128>
mov    0x18(%rbp),%rax
movl   $0x1,(%rax)
jmp    1258 <parseArguments+0x128>
mov    0x2dc4(%rip),%rax
mov    (%rax),%edi
call   1050 <atoi@plt>
imul   $0xf4240,%eax,%ecx
mov    0x20(%rbp),%rax
mov    %ecx,(%rax)
jmp    1258 <parseArguments+0x128>
movl   $0x1,-0x4(%rbp)
jmp    1264 <parseArguments+0x134>
jmp    115b <parseArguments+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseArguments>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,0x10(%rsp)
mov    %r8,0x8(%rsp)
mov    %rcx,(%rsp)
mov    %rdx,%r13
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xef9(%rip),%r14
lea    0xe9e(%rip),%r15
mov    0x2e8f(%rip),%r12
jmp    1190 <parseArguments+0x60>
mov    (%r12),%edi
call   1050 <atoi@plt>
imul   $0xf4240,%eax,%eax
mov    0x60(%rsp),%rcx
mov    %eax,(%rcx)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <getopt@plt>
lea    -0x63(%rax),%ecx
cmp    $0x14,%ecx
ja     120e <parseArguments+0xde>
movslq (%r15,%rcx,4),%rax
add    %r15,%rax
jmp    *%rax
mov    0x58(%rsp),%rax
movl   $0x1,(%rax)
jmp    1190 <parseArguments+0x60>
mov    (%r12),%edi
call   1050 <atoi@plt>
mov    0x10(%rsp),%rcx
mov    %eax,(%rcx)
jmp    1190 <parseArguments+0x60>
mov    (%rsp),%rax
movl   $0x1,(%rax)
jmp    1190 <parseArguments+0x60>
mov    (%r12),%edi
call   1050 <atoi@plt>
mov    %eax,0x0(%r13)
jmp    1190 <parseArguments+0x60>
mov    (%r12),%edi
call   1030 <atof@plt>
mov    0x50(%rsp),%rax
movsd  %xmm0,(%rax)
jmp    1190 <parseArguments+0x60>
mov    (%r12),%edi
call   1050 <atoi@plt>
mov    0x8(%rsp),%rcx
mov    %eax,(%rcx)
jmp    1190 <parseArguments+0x60>
cmp    $0xffffffff,%eax
jne    1217 <parseArguments+0xe7>
xor    %eax,%eax
jmp    121c <parseArguments+0xec>
mov    $0x1,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"s:t:w:h:pcd:\00"
@optarg = global i32 0
define i32 @parseArguments(i32 %0, i8** %1, i32* %2, i32* %3, i32* %4, i32* %5, double* %6, i32* %7, i32* %8) {
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8**
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca double*
%18 = alloca i32*
%19 = alloca i32*
%20 = alloca i32
store i32 %0, i32* %11
store i8** %1, i8*** %12
store i32* %2, i32** %13
store i32* %3, i32** %14
store i32* %4, i32** %15
store i32* %5, i32** %16
store double* %6, double** %17
store i32* %7, i32** %18
store i32* %8, i32** %19
br label %21
21: ; preds = %54, %9
%22 = load i32, i32* %11
%23 = load i8**, i8*** %12
%24 = call i32 @getopt(i32 %22, i8** %23, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i32 %24, i32* %20
%25 = icmp ne i32 %24, -1
br i1 %25, label %26, label %55
26: ; preds = %21
%27 = load i32, i32* %20
switch i32 %27, label %53 [
i32 115, label %28
i32 116, label %32
i32 119, label %36
i32 104, label %40
i32 112, label %44
i32 99, label %46
i32 100, label %48
]
28: ; preds = %26
%29 = load i32, i32* @optarg
%30 = call i32 @atoi(i32 %29)
%31 = load i32*, i32** %13
store i32 %30, i32* %31
br label %54
32: ; preds = %26
%33 = load i32, i32* @optarg
%34 = call double @atof(i32 %33)
%35 = load double*, double** %17
store double %34, double* %35
br label %54
36: ; preds = %26
%37 = load i32, i32* @optarg
%38 = call i32 @atoi(i32 %37)
%39 = load i32*, i32** %15
store i32 %38, i32* %39
br label %54
40: ; preds = %26
%41 = load i32, i32* @optarg
%42 = call i32 @atoi(i32 %41)
%43 = load i32*, i32** %16
store i32 %42, i32* %43
br label %54
44: ; preds = %26
%45 = load i32*, i32** %14
store i32 1, i32* %45
br label %54
46: ; preds = %26
%47 = load i32*, i32** %18
store i32 1, i32* %47
br label %54
48: ; preds = %26
%49 = load i32, i32* @optarg
%50 = call i32 @atoi(i32 %49)
%51 = mul nsw i32 %50, 1000000
%52 = load i32*, i32** %19
store i32 %51, i32* %52
br label %54
53: ; preds = %26
store i32 1, i32* %10
br label %56
54: ; preds = %48, %46, %44, %40, %36, %32, %28
br label %21
55: ; preds = %21
store i32 0, i32* %10
br label %56
56: ; preds = %55, %53
%57 = load i32, i32* %10
ret i32 %57
}

LLVM IR (-O2):
@.str = [13 x i8] c"s:t:w:h:pcd:\00"
@optarg = global i32 0
define i32 @parseArguments(i32 %0, i8** %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4, i32* nocapture writeonly %5, double* nocapture writeonly %6, i32* nocapture writeonly %7, i32* nocapture writeonly %8) {
br label %10
10: ; preds = %30, %9
%11 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
switch i32 %11, label %31 [
i32 -1, label %32
i32 115, label %12
i32 116, label %15
i32 119, label %18
i32 104, label %21
i32 112, label %24
i32 99, label %25
i32 100, label %26
]
12: ; preds = %10
%13 = load i32, i32* @optarg
%14 = tail call i32 @atoi(i32 %13)
store i32 %14, i32* %2
br label %30
15: ; preds = %10
%16 = load i32, i32* @optarg
%17 = tail call double @atof(i32 %16)
store double %17, double* %6
br label %30
18: ; preds = %10
%19 = load i32, i32* @optarg
%20 = tail call i32 @atoi(i32 %19)
store i32 %20, i32* %4
br label %30
21: ; preds = %10
%22 = load i32, i32* @optarg
%23 = tail call i32 @atoi(i32 %22)
store i32 %23, i32* %5
br label %30
24: ; preds = %10
store i32 1, i32* %3
br label %30
25: ; preds = %10
store i32 1, i32* %7
br label %30
26: ; preds = %10
%27 = load i32, i32* @optarg
%28 = tail call i32 @atoi(i32 %27)
%29 = mul nsw i32 %28, 1000000
store i32 %29, i32* %8
br label %30
30: ; preds = %26, %25, %24, %21, %18, %15, %12
br label %10
31: ; preds = %10
br label %32
32: ; preds = %10, %31
%33 = phi i32 [ 1, %31 ], [ 0, %10 ]
ret i32 %33
}