#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 */
scalar_t__ _strings(int, int, char **);
int _usage();
int getopt(int, char **, char *);
char *optarg;
int optind;
int strtol(char *, char **, int);
int main(int argc, char *argv[]) {
  int o;
  int flgn = 4;
  char *p;
  while ((o = getopt(argc, argv, "at:n:")) != -1)
    switch (o) {
    case 'a':
      break;
    case 't':
      break;
    case 'n':
      flgn = strtol(optarg, &p, 10);
      if (*optarg == '\0' || *p != '\0')
        return _usage();
      break;
    default:
      return _usage();
    }
  return _strings(flgn, argc - optind, &argv[optind]) == 0 ? 0 : 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x4,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe95(%rip),%rdx
call   1060 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     1225 <main+0xe5>
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
sub    $0x61,%eax
je     11b2 <main+0x72>
jmp    1190 <main+0x50>
mov    -0x24(%rbp),%eax
sub    $0x6e,%eax
je     11bc <main+0x7c>
jmp    11a1 <main+0x61>
mov    -0x24(%rbp),%eax
sub    $0x74,%eax
je     11b7 <main+0x77>
jmp    1211 <main+0xd1>
jmp    1220 <main+0xe0>
jmp    1220 <main+0xe0>
mov    0x2e35(%rip),%rax
mov    (%rax),%rdi
lea    -0x20(%rbp),%rsi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %eax,-0x18(%rbp)
mov    0x2e1a(%rip),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11fd <main+0xbd>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     120c <main+0xcc>
mov    $0x0,%al
call   1030 <_usage@plt>
mov    %eax,-0x4(%rbp)
jmp    1262 <main+0x122>
jmp    1220 <main+0xe0>
mov    $0x0,%al
call   1030 <_usage@plt>
mov    %eax,-0x4(%rbp)
jmp    1262 <main+0x122>
jmp    115d <main+0x1d>
mov    -0x18(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2dae(%rip),%rax
sub    (%rax),%esi
mov    -0x10(%rbp),%rdx
mov    0x2da1(%rip),%rax
movslq (%rax),%rax
shl    $0x3,%rax
add    %rax,%rdx
call   1050 <_strings@plt>
mov    %rax,%rdx
mov    $0x2,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
mov    $0x4,%r15d
lea    0xea3(%rip),%rbp
mov    0x2e94(%rip),%r13
mov    %rsp,%r12
jmp    1175 <main+0x35>
nopl   0x0(%rax)
cmp    $0x74,%eax
jne    118e <main+0x4e>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %rbp,%rdx
call   1060 <getopt@plt>
cmp    $0x6d,%eax
jg     1170 <main+0x30>
cmp    $0x61,%eax
je     1175 <main+0x35>
jmp    11bb <main+0x7b>
cmp    $0x6e,%eax
jne    11f5 <main+0xb5>
mov    0x0(%r13),%rdi
mov    %r12,%rsi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %eax,%r15d
mov    0x0(%r13),%rax
cmpb   $0x0,(%rax)
je     11f5 <main+0xb5>
mov    (%rsp),%rax
cmpb   $0x0,(%rax)
je     1175 <main+0x35>
jmp    11f5 <main+0xb5>
cmp    $0xffffffff,%eax
jne    11f5 <main+0xb5>
mov    0x2e19(%rip),%rax
movslq (%rax),%rax
sub    %eax,%ebx
lea    (%r14,%rax,8),%rdx
mov    %r15d,%edi
mov    %ebx,%esi
call   1050 <_strings@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
add    %ecx,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <_usage@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"at:n:\00"
@optarg = global i8* null
@optind = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 4, i32* %7
br label %9
9: ; preds = %35, %2
%10 = load i32, i32* %4
%11 = load i8**, i8*** %5
%12 = call i32 @getopt(i32 %10, i8** %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 %12, i32* %6
%13 = icmp ne i32 %12, -1
br i1 %13, label %14, label %36
14: ; preds = %9
%15 = load i32, i32* %6
switch i32 %15, label %33 [
i32 97, label %16
i32 116, label %17
i32 110, label %18
]
16: ; preds = %14
br label %35
17: ; preds = %14
br label %35
18: ; preds = %14
%19 = load i8*, i8** @optarg
%20 = call i32 @strtol(i8* %19, i8** %8, i32 10)
store i32 %20, i32* %7
%21 = load i8*, i8** @optarg
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 0
br i1 %24, label %30, label %25
25: ; preds = %18
%26 = load i8*, i8** %8
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %25, %18
%31 = call i32 (...) @_usage()
store i32 %31, i32* %3
br label %49
32: ; preds = %25
br label %35
33: ; preds = %14
%34 = call i32 (...) @_usage()
store i32 %34, i32* %3
br label %49
35: ; preds = %32, %17, %16
br label %9
36: ; preds = %9
%37 = load i32, i32* %7
%38 = load i32, i32* %4
%39 = load i32, i32* @optind
%40 = sub nsw i32 %38, %39
%41 = load i8**, i8*** %5
%42 = load i32, i32* @optind
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i8*, i8** %41, i64 %43
%45 = call i64 @_strings(i32 %37, i32 %40, i8** %44)
%46 = icmp eq i64 %45, 0
%47 = zext i1 %46 to i64
%48 = select i1 %46, i32 0, i32 2
store i32 %48, i32* %3
br label %49
49: ; preds = %36, %33, %30
%50 = load i32, i32* %3
ret i32 %50
}

LLVM IR (-O2):
@.str = [6 x i8] c"at:n:\00"
@optarg = global i8* null
@optind = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
br label %5
5: ; preds = %16, %2
%6 = phi i32 [ %12, %16 ], [ 4, %2 ]
br label %7
7: ; preds = %9, %5
%8 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
switch i32 %8, label %22 [
i32 -1, label %24
i32 97, label %9
i32 116, label %9
i32 110, label %10
]
9: ; preds = %7, %7
br label %7
10: ; preds = %7
%11 = load i8*, i8** @optarg
%12 = call i32 @strtol(i8* %11, i8** %3, i32 10)
%13 = load i8*, i8** @optarg
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %20, label %16
16: ; preds = %10
%17 = load i8*, i8** %3
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 0
br i1 %19, label %5, label %20
20: ; preds = %16, %10
%21 = tail call i32 (...) @_usage()
br label %32
22: ; preds = %7
%23 = tail call i32 (...) @_usage()
br label %32
24: ; preds = %7
%25 = load i32, i32* @optind
%26 = sub nsw i32 %0, %25
%27 = sext i32 %25 to i64
%28 = getelementptr inbounds i8*, i8** %1, i64 %27
%29 = tail call i64 @_strings(i32 %6, i32 %26, i8** %28)
%30 = icmp eq i64 %29, 0
%31 = select i1 %30, i32 0, i32 2
br label %32
32: ; preds = %24, %22, %20
%33 = phi i32 [ %23, %22 ], [ %21, %20 ], [ %31, %24 ]
ret i32 %33
}