#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*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ hms2degs_batch(char *, char *);
int /*<<< orphan*/ hms2degs_help();
int /*<<< orphan*/ hms2degs_interactive();
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  int no_error = 1;
  switch (argc) {
  case 1:
    hms2degs_help();
    return 1;
    break;
  case 2:
    if (strcmp(argv[1], "-i") == 0) {
      if (hms2degs_interactive())
        no_error = 0;
    } else {
      hms2degs_help();
    }
    break;
  case 3:
    if (strcmp(argv[1], "-b") == 0) {
      if (hms2degs_batch(argv[2], NULL))
        no_error = 0;
    } else if (strcmp(argv[1], "-i") == 0) {
      if (hms2degs_interactive())
        no_error = 0;
    } else {
      hms2degs_help();
    }
    break;
  case 4:
    if (strcmp(argv[1], "-b") == 0) {
      if (hms2degs_batch(argv[2], argv[3]))
        no_error = 0;
    } else if (strcmp(argv[1], "-i") == 0) {
      if (hms2degs_interactive())
        no_error = 0;
    } else {
      hms2degs_help();
    }
    break;
  default:
    fprintf(stderr, "\n***WARNING: Too many arguments.***\n\n");
    hms2degs_help();
    return 1;
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x3,%eax
ja     130c <main+0x1bc>
mov    -0x20(%rbp),%rax
lea    0xe73(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1070 <hms2degs_help@plt>
movl   $0x1,-0x4(%rbp)
jmp    133b <main+0x1eb>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe58(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11e2 <main+0x92>
mov    $0x0,%al
call   1030 <hms2degs_interactive@plt>
cmp    $0x0,%eax
je     11dd <main+0x8d>
movl   $0x0,-0x14(%rbp)
jmp    11e9 <main+0x99>
mov    $0x0,%al
call   1070 <hms2degs_help@plt>
jmp    1334 <main+0x1e4>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe16(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1231 <main+0xe1>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <hms2degs_batch@plt>
cmp    $0x0,%eax
je     122c <main+0xdc>
movl   $0x0,-0x14(%rbp)
jmp    1276 <main+0x126>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdd0(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    126a <main+0x11a>
mov    $0x0,%al
call   1030 <hms2degs_interactive@plt>
cmp    $0x0,%eax
je     1265 <main+0x115>
movl   $0x0,-0x14(%rbp)
jmp    1271 <main+0x121>
mov    $0x0,%al
call   1070 <hms2degs_help@plt>
jmp    1276 <main+0x126>
jmp    1334 <main+0x1e4>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd89(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    12c2 <main+0x172>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
call   1060 <hms2degs_batch@plt>
cmp    $0x0,%eax
je     12bd <main+0x16d>
movl   $0x0,-0x14(%rbp)
jmp    1307 <main+0x1b7>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd3f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    12fb <main+0x1ab>
mov    $0x0,%al
call   1030 <hms2degs_interactive@plt>
cmp    $0x0,%eax
je     12f6 <main+0x1a6>
movl   $0x0,-0x14(%rbp)
jmp    1302 <main+0x1b2>
mov    $0x0,%al
call   1070 <hms2degs_help@plt>
jmp    1307 <main+0x1b7>
jmp    1334 <main+0x1e4>
mov    0x2ccd(%rip),%rax
mov    (%rax),%edi
lea    0xcfa(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1070 <hms2degs_help@plt>
movl   $0x1,-0x4(%rbp)
jmp    133b <main+0x1eb>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
add    $0xffffffff,%edi
cmp    $0x3,%edi
ja     117c <main+0x2c>
mov    %rsi,%rbx
lea    0xe9a(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
mov    0x8(%rbx),%rdi
lea    0xe96(%rip),%rsi
jmp    11e6 <main+0x96>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
lea    0xe8a(%rip),%rsi
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1070 <hms2degs_help@plt>
mov    $0x1,%ebx
jmp    1212 <main+0xc2>
mov    0x8(%rbx),%r14
lea    0xe69(%rip),%rsi
mov    %r14,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    11dc <main+0x8c>
mov    0x10(%rbx),%rdi
xor    %ebx,%ebx
xor    %esi,%esi
call   1060 <hms2degs_batch@plt>
jmp    1212 <main+0xc2>
mov    0x8(%rbx),%r14
lea    0xe43(%rip),%rsi
mov    %r14,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1203 <main+0xb3>
lea    0xe2d(%rip),%rsi
mov    %r14,%rdi
call   1040 <strcmp@plt>
xor    %ebx,%ebx
test   %eax,%eax
je     11fa <main+0xaa>
xor    %eax,%eax
call   1070 <hms2degs_help@plt>
jmp    1212 <main+0xc2>
xor    %eax,%eax
call   1030 <hms2degs_interactive@plt>
jmp    1212 <main+0xc2>
mov    0x10(%rbx),%rdi
mov    0x18(%rbx),%rsi
call   1060 <hms2degs_batch@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-i\00"
@.str.1 = [3 x i8] c"-b\00"
@stderr = global i32 0
@.str.2 = [38 x i8] c"\0A***WARNING: Too many arguments.***\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
%7 = load i32, i32* %4
switch i32 %7, label %85 [
i32 1, label %8
i32 2, label %10
i32 3, label %24
i32 4, label %53
]
8: ; preds = %2
%9 = call i32 (...) @hms2degs_help()
store i32 1, i32* %3
br label %90
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @strcmp(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %10
%17 = call i32 (...) @hms2degs_interactive()
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %16
store i32 0, i32* %6
br label %20
20: ; preds = %19, %16
br label %23
21: ; preds = %10
%22 = call i32 (...) @hms2degs_help()
br label %23
23: ; preds = %21, %20
br label %89
24: ; preds = %2
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = call i32 @strcmp(i8* %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %38
30: ; preds = %24
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 2
%33 = load i8*, i8** %32
%34 = call i32 @hms2degs_batch(i8* %33, i8* null)
%35 = icmp ne i32 %34, 0
br i1 %35, label %36, label %37
36: ; preds = %30
store i32 0, i32* %6
br label %37
37: ; preds = %36, %30
br label %52
38: ; preds = %24
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 1
%41 = load i8*, i8** %40
%42 = call i32 @strcmp(i8* %41, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%43 = icmp eq i32 %42, 0
br i1 %43, label %44, label %49
44: ; preds = %38
%45 = call i32 (...) @hms2degs_interactive()
%46 = icmp ne i32 %45, 0
br i1 %46, label %47, label %48
47: ; preds = %44
store i32 0, i32* %6
br label %48
48: ; preds = %47, %44
br label %51
49: ; preds = %38
%50 = call i32 (...) @hms2degs_help()
br label %51
51: ; preds = %49, %48
br label %52
52: ; preds = %51, %37
br label %89
53: ; preds = %2
%54 = load i8**, i8*** %5
%55 = getelementptr inbounds i8*, i8** %54, i64 1
%56 = load i8*, i8** %55
%57 = call i32 @strcmp(i8* %56, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%58 = icmp eq i32 %57, 0
br i1 %58, label %59, label %70
59: ; preds = %53
%60 = load i8**, i8*** %5
%61 = getelementptr inbounds i8*, i8** %60, i64 2
%62 = load i8*, i8** %61
%63 = load i8**, i8*** %5
%64 = getelementptr inbounds i8*, i8** %63, i64 3
%65 = load i8*, i8** %64
%66 = call i32 @hms2degs_batch(i8* %62, i8* %65)
%67 = icmp ne i32 %66, 0
br i1 %67, label %68, label %69
68: ; preds = %59
store i32 0, i32* %6
br label %69
69: ; preds = %68, %59
br label %84
70: ; preds = %53
%71 = load i8**, i8*** %5
%72 = getelementptr inbounds i8*, i8** %71, i64 1
%73 = load i8*, i8** %72
%74 = call i32 @strcmp(i8* %73, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%75 = icmp eq i32 %74, 0
br i1 %75, label %76, label %81
76: ; preds = %70
%77 = call i32 (...) @hms2degs_interactive()
%78 = icmp ne i32 %77, 0
br i1 %78, label %79, label %80
79: ; preds = %76
store i32 0, i32* %6
br label %80
80: ; preds = %79, %76
br label %83
81: ; preds = %70
%82 = call i32 (...) @hms2degs_help()
br label %83
83: ; preds = %81, %80
br label %84
84: ; preds = %83, %69
br label %89
85: ; preds = %2
%86 = load i32, i32* @stderr
%87 = call i32 @fprintf(i32 %86, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%88 = call i32 (...) @hms2degs_help()
store i32 1, i32* %3
br label %90
89: ; preds = %84, %52, %23
store i32 0, i32* %3
br label %90
90: ; preds = %89, %85, %8
%91 = load i32, i32* %3
ret i32 %91
}

LLVM IR (-O2):
@.str = [3 x i8] c"-i\00"
@.str.1 = [3 x i8] c"-b\00"
@stderr = global i32 0
@.str.2 = [38 x i8] c"\0A***WARNING: Too many arguments.***\0A\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
switch i32 %0, label %48 [
i32 1, label %3
i32 2, label %5
i32 3, label %14
i32 4, label %30
]
3: ; preds = %2
%4 = tail call i32 (...) @hms2degs_help()
br label %52
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @strcmp(i8* dereferenceable(1) %7, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %5
%11 = tail call i32 (...) @hms2degs_interactive()
br label %52
12: ; preds = %5
%13 = tail call i32 (...) @hms2degs_help()
br label %52
14: ; preds = %2
%15 = getelementptr inbounds i8*, i8** %1, i64 1
%16 = load i8*, i8** %15
%17 = tail call i32 @strcmp(i8* dereferenceable(1) %16, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %14
%20 = getelementptr inbounds i8*, i8** %1, i64 2
%21 = load i8*, i8** %20
%22 = tail call i32 @hms2degs_batch(i8* %21, i8* null)
br label %52
23: ; preds = %14
%24 = tail call i32 @strcmp(i8* dereferenceable(1) %16, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = tail call i32 (...) @hms2degs_interactive()
br label %52
28: ; preds = %23
%29 = tail call i32 (...) @hms2degs_help()
br label %52
30: ; preds = %2
%31 = getelementptr inbounds i8*, i8** %1, i64 1
%32 = load i8*, i8** %31
%33 = tail call i32 @strcmp(i8* dereferenceable(1) %32, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%34 = icmp eq i32 %33, 0
br i1 %34, label %35, label %41
35: ; preds = %30
%36 = getelementptr inbounds i8*, i8** %1, i64 2
%37 = load i8*, i8** %36
%38 = getelementptr inbounds i8*, i8** %1, i64 3
%39 = load i8*, i8** %38
%40 = tail call i32 @hms2degs_batch(i8* %37, i8* %39)
br label %52
41: ; preds = %30
%42 = tail call i32 @strcmp(i8* dereferenceable(1) %32, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%43 = icmp eq i32 %42, 0
br i1 %43, label %44, label %46
44: ; preds = %41
%45 = tail call i32 (...) @hms2degs_interactive()
br label %52
46: ; preds = %41
%47 = tail call i32 (...) @hms2degs_help()
br label %52
48: ; preds = %2
%49 = load i32, i32* @stderr
%50 = tail call i32 @fprintf(i32 %49, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%51 = tail call i32 (...) @hms2degs_help()
br label %52
52: ; preds = %44, %35, %26, %19, %10, %12, %28, %46, %48, %3
%53 = phi i32 [ 1, %48 ], [ 1, %3 ], [ 0, %35 ], [ 0, %44 ], [ 0, %46 ], [ 0, %19 ], [ 0, %26 ], [ 0, %28 ], [ 0, %12 ], [ 0, %10 ]
ret i32 %53
}