#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*/ abmags2flux_help();
int /*<<< orphan*/ abmags2flux_interactive();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  int no_error = 1;
  switch (argc) {
  case 1:
    abmags2flux_help();
    return 1;
    break;
  case 2:
    if (strcmp(argv[1], "-i") == 0) {
      if (abmags2flux_interactive())
        no_error = 0;
    } else {
      abmags2flux_help();
    }
    break;
  default:
    fprintf(stderr, "\n***WARNING: Too many arguments.***\n\n");
    abmags2flux_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
mov    %eax,-0x18(%rbp)
sub    $0x1,%eax
je     1182 <main+0x42>
jmp    1171 <main+0x31>
mov    -0x18(%rbp),%eax
sub    $0x2,%eax
je     1195 <main+0x55>
jmp    11da <main+0x9a>
mov    $0x0,%al
call   1060 <abmags2flux_help@plt>
movl   $0x1,-0x4(%rbp)
jmp    1209 <main+0xc9>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe5c(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    11ce <main+0x8e>
mov    $0x0,%al
call   1050 <abmags2flux_interactive@plt>
cmp    $0x0,%eax
je     11c9 <main+0x89>
movl   $0x0,-0x14(%rbp)
jmp    11d5 <main+0x95>
mov    $0x0,%al
call   1060 <abmags2flux_help@plt>
jmp    1202 <main+0xc2>
mov    0x2dff(%rip),%rax
mov    (%rax),%edi
lea    0xe19(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1060 <abmags2flux_help@plt>
movl   $0x1,-0x4(%rbp)
jmp    1209 <main+0xc9>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
je     116e <main+0x2e>
cmp    $0x1,%edi
je     1160 <main+0x20>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1060 <abmags2flux_help@plt>
mov    $0x1,%ebx
jmp    1194 <main+0x54>
mov    0x8(%rsi),%rdi
lea    0xe87(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ebx,%ebx
test   %eax,%eax
je     118d <main+0x4d>
xor    %eax,%eax
call   1060 <abmags2flux_help@plt>
jmp    1194 <main+0x54>
xor    %eax,%eax
call   1050 <abmags2flux_interactive@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-i\00"
@stderr = global i32 0
@.str.1 = [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 %24 [
i32 1, label %8
i32 2, label %10
]
8: ; preds = %2
%9 = call i32 (...) @abmags2flux_help()
store i32 1, i32* %3
br label %29
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 (...) @abmags2flux_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 (...) @abmags2flux_help()
br label %23
23: ; preds = %21, %20
br label %28
24: ; preds = %2
%25 = load i32, i32* @stderr
%26 = call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%27 = call i32 (...) @abmags2flux_help()
store i32 1, i32* %3
br label %29
28: ; preds = %23
store i32 0, i32* %3
br label %29
29: ; preds = %28, %24, %8
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
@.str = [3 x i8] c"-i\00"
@stderr = global i32 0
@.str.1 = [38 x i8] c"\0A***WARNING: Too many arguments.***\0A\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
switch i32 %0, label %14 [
i32 1, label %3
i32 2, label %5
]
3: ; preds = %2
%4 = tail call i32 (...) @abmags2flux_help()
br label %18
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 (...) @abmags2flux_interactive()
br label %18
12: ; preds = %5
%13 = tail call i32 (...) @abmags2flux_help()
br label %18
14: ; preds = %2
%15 = load i32, i32* @stderr
%16 = tail call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%17 = tail call i32 (...) @abmags2flux_help()
br label %18
18: ; preds = %10, %12, %14, %3
%19 = phi i32 [ 1, %14 ], [ 1, %3 ], [ 0, %12 ], [ 0, %10 ]
ret i32 %19
}