#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*/ _protoid(char *);
int _protoid_usage();
int getopt(int, char **, char *);
int optind;
int main(int argc, char *argv[]) {
  int o;
  int i;
  while ((o = getopt(argc, argv, "")) != -1)
    switch (o) {
    default:
      return _protoid_usage();
    }
  if (optind == argc)
    return _protoid_usage();
  for (i = optind; i < argc; i++)
    _protoid(argv[i]);
  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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xeac(%rip),%rdx
call   1050 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     1174 <main+0x44>
mov    $0x0,%al
call   1030 <_protoid_usage@plt>
mov    %eax,-0x4(%rbp)
jmp    11d3 <main+0xa3>
mov    0x2e6d(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jne    1195 <main+0x65>
mov    $0x0,%al
call   1030 <_protoid_usage@plt>
mov    %eax,-0x4(%rbp)
jmp    11d3 <main+0xa3>
mov    0x2e4c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11cc <main+0x9c>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <_protoid@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11a1 <main+0x71>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%r15d
lea    0xebe(%rip),%rdx
call   1050 <getopt@plt>
cmp    $0xffffffff,%eax
jne    115b <main+0x2b>
mov    0x2e95(%rip),%rax
movslq (%rax),%rax
cmp    %r15d,%eax
jne    1167 <main+0x37>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <_protoid_usage@plt>
cmp    %r15d,%eax
jge    1192 <main+0x62>
lea    (%r14,%rax,8),%r14
sub    %eax,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
call   1040 <_protoid@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1180 <main+0x50>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %8
8: ; preds = %2
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = call i32 @getopt(i32 %9, i8** %10, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store i32 %11, i32* %6
%12 = icmp ne i32 %11, -1
br i1 %12, label %13, label %17
13: ; preds = %8
%14 = load i32, i32* %6
switch i32 %14, label %15 [
]
15: ; preds = %13
%16 = call i32 (...) @_protoid_usage()
store i32 %16, i32* %3
br label %40
17: ; preds = %8
%18 = load i32, i32* @optind
%19 = load i32, i32* %4
%20 = icmp eq i32 %18, %19
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = call i32 (...) @_protoid_usage()
store i32 %22, i32* %3
br label %40
23: ; preds = %17
%24 = load i32, i32* @optind
store i32 %24, i32* %7
br label %25
25: ; preds = %36, %23
%26 = load i32, i32* %7
%27 = load i32, i32* %4
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %39
29: ; preds = %25
%30 = load i8**, i8*** %5
%31 = load i32, i32* %7
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8*, i8** %30, i64 %32
%34 = load i8*, i8** %33
%35 = call i32 @_protoid(i8* %34)
br label %36
36: ; preds = %29
%37 = load i32, i32* %7
%38 = add nsw i32 %37, 1
store i32 %38, i32* %7
br label %25
39: ; preds = %25
store i32 0, i32* %3
br label %40
40: ; preds = %39, %21, %15
%41 = load i32, i32* %3
ret i32 %41
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@optind = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %20
5: ; preds = %2
%6 = load i32, i32* @optind
%7 = icmp eq i32 %6, %0
br i1 %7, label %20, label %8
8: ; preds = %5
%9 = icmp slt i32 %6, %0
br i1 %9, label %10, label %22
10: ; preds = %8
%11 = sext i32 %6 to i64
br label %12
12: ; preds = %10, %12
%13 = phi i64 [ %11, %10 ], [ %17, %12 ]
%14 = getelementptr inbounds i8*, i8** %1, i64 %13
%15 = load i8*, i8** %14
%16 = tail call i32 @_protoid(i8* %15)
%17 = add nsw i64 %13, 1
%18 = trunc i64 %17 to i32
%19 = icmp eq i32 %18, %0
br i1 %19, label %22, label %12
20: ; preds = %5, %2
%21 = tail call i32 (...) @_protoid_usage()
br label %22
22: ; preds = %12, %20, %8
%23 = phi i32 [ 0, %8 ], [ %21, %20 ], [ 0, %12 ]
ret i32 %23
}