#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*/ acct(char *);
int /*<<< orphan*/ err(int, char *, ...);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getopt(int, char **, char *);
scalar_t__ optind;
int /*<<< orphan*/ usage();
int main(int argc, char *argv[]) {
  int ch;
  while ((ch = getopt(argc, argv, "")) != -1)
    switch (ch) {
    case '?':
    default:
      usage();
    }
  argc -= optind;
  argv += optind;
  switch (argc) {
  case 0:
    if (acct(NULL))
      err(1, NULL);
    break;
  case 1:
    if (acct(*argv))
      err(1, "%s", *argv);
    break;
  default:
    usage();
  }
  exit(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    0xe8e(%rip),%rdx
call   1060 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     11a7 <main+0x57>
mov    -0x14(%rbp),%eax
sub    $0x3f,%eax
jne    119b <main+0x4b>
jmp    1196 <main+0x46>
jmp    119b <main+0x4b>
mov    $0x0,%al
call   1050 <usage@plt>
jmp    1166 <main+0x16>
mov    0x2e3a(%rip),%rax
mov    (%rax),%edx
mov    -0x8(%rbp),%ecx
sub    %edx,%ecx
mov    %ecx,-0x8(%rbp)
mov    (%rax),%rcx
mov    -0x10(%rbp),%rax
lea    (%rax,%rcx,8),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
test   %eax,%eax
je     11eb <main+0x9b>
jmp    11da <main+0x8a>
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
je     1212 <main+0xc2>
jmp    1246 <main+0xf6>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <acct@plt>
cmp    $0x0,%eax
je     120d <main+0xbd>
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x0,%al
call   1040 <err@plt>
jmp    124d <main+0xfd>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <acct@plt>
cmp    $0x0,%eax
je     1241 <main+0xf1>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    $0x1,%edi
lea    0xdc6(%rip),%rsi
mov    $0x0,%al
call   1040 <err@plt>
jmp    124d <main+0xfd>
mov    $0x0,%al
call   1050 <usage@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xea2(%rip),%rdx
call   1060 <getopt@plt>
cmp    $0xffffffff,%eax
je     1199 <main+0x49>
lea    0xe91(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <usage@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1060 <getopt@plt>
cmp    $0xffffffff,%eax
jne    1180 <main+0x30>
mov    0x2e48(%rip),%rax
mov    (%rax),%r14
sub    %r14d,%ebp
cmp    $0x1,%ebp
je     11cf <main+0x7f>
test   %ebp,%ebp
jne    11fa <main+0xaa>
xor    %edi,%edi
call   1030 <acct@plt>
test   %eax,%eax
je     1201 <main+0xb1>
mov    $0x1,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <err@plt>
xor    %edi,%edi
call   1070 <exit@plt>
mov    (%rbx,%r14,8),%rdi
call   1030 <acct@plt>
test   %eax,%eax
je     1201 <main+0xb1>
mov    (%rbx,%r14,8),%rdx
lea    0xe19(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <err@plt>
xor    %edi,%edi
call   1070 <exit@plt>
xor    %eax,%eax
call   1050 <usage@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@optind = global i64 0
@.str.1 = [3 x i8] c"%s\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
br label %7
7: ; preds = %17, %2
%8 = load i32, i32* %4
%9 = load i8**, i8*** %5
%10 = call i32 @getopt(i32 %8, i8** %9, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store i32 %10, i32* %6
%11 = icmp ne i32 %10, -1
br i1 %11, label %12, label %18
12: ; preds = %7
%13 = load i32, i32* %6
switch i32 %13, label %15 [
i32 63, label %14
]
14: ; preds = %12
br label %15
15: ; preds = %12, %14
%16 = call i32 (...) @usage()
br label %17
17: ; preds = %15
br label %7
18: ; preds = %7
%19 = load i64, i64* @optind
%20 = load i32, i32* %4
%21 = sext i32 %20 to i64
%22 = sub nsw i64 %21, %19
%23 = trunc i64 %22 to i32
store i32 %23, i32* %4
%24 = load i64, i64* @optind
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 %24
store i8** %26, i8*** %5
%27 = load i32, i32* %4
switch i32 %27, label %44 [
i32 0, label %28
i32 1, label %34
]
28: ; preds = %18
%29 = call i32 @acct(i8* null)
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = call i32 (i32, i8*, ...) @err(i32 1, i8* null)
br label %33
33: ; preds = %31, %28
br label %46
34: ; preds = %18
%35 = load i8**, i8*** %5
%36 = load i8*, i8** %35
%37 = call i32 @acct(i8* %36)
%38 = icmp ne i32 %37, 0
br i1 %38, label %39, label %43
39: ; preds = %34
%40 = load i8**, i8*** %5
%41 = load i8*, i8** %40
%42 = call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %41)
br label %43
43: ; preds = %39, %34
br label %46
44: ; preds = %18
%45 = call i32 (...) @usage()
br label %46
46: ; preds = %44, %43, %33
%47 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@optind = global i64 0
@.str.1 = [3 x i8] c"%s\00"
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 %9, label %5
5: ; preds = %2, %5
%6 = tail call i32 (...) @usage()
%7 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %5
9: ; preds = %5, %2
%10 = load i64, i64* @optind
%11 = trunc i64 %10 to i32
%12 = sub i32 %0, %11
%13 = getelementptr inbounds i8*, i8** %1, i64 %10
switch i32 %12, label %26 [
i32 0, label %14
i32 1, label %19
]
14: ; preds = %9
%15 = tail call i32 @acct(i8* null)
%16 = icmp eq i32 %15, 0
br i1 %16, label %28, label %17
17: ; preds = %14
%18 = tail call i32 (i32, i8*, ...) @err(i32 1, i8* null)
br label %28
19: ; preds = %9
%20 = load i8*, i8** %13
%21 = tail call i32 @acct(i8* %20)
%22 = icmp eq i32 %21, 0
br i1 %22, label %28, label %23
23: ; preds = %19
%24 = load i8*, i8** %13
%25 = tail call i32 (i32, i8*, ...) @err(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %24)
br label %28
26: ; preds = %9
%27 = tail call i32 (...) @usage()
br label %28
28: ; preds = %19, %23, %14, %17, %26
%29 = tail call i32 @exit(i32 0)
unreachable
}