#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__ do_touch(char *, unsigned int);
int /*<<< orphan*/ err(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
int getopt(int, char **, char *);
scalar_t__ optind;
int /*<<< orphan*/ usage();
int main(int argc, char *argv[]) {
  unsigned int flags;
  int ch;
  flags = 0;
  while ((ch = getopt(argc, argv, "")) != -1)
    switch (ch) {
    case 'c':
      flags |= 0x01;
      break;
    case '?':
    default:
      usage();
    }
  argc -= optind;
  argv += optind;
  if (argc == 0)
    usage();
  do {
    if (do_touch(*argv, flags))
      err(1, NULL);
    ++argv;
  } while (*argv);
  exit(1);
}


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   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe85(%rip),%rdx
call   1060 <getopt@plt>
mov    %eax,-0x18(%rbp)
cmp    $0xffffffff,%eax
je     11d0 <main+0x80>
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x3f,%eax
je     11bf <main+0x6f>
jmp    11a0 <main+0x50>
mov    -0x1c(%rbp),%eax
sub    $0x63,%eax
jne    11c4 <main+0x74>
jmp    11b1 <main+0x61>
mov    -0x14(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11cb <main+0x7b>
jmp    11c4 <main+0x74>
mov    $0x0,%al
call   1050 <usage@plt>
jmp    116d <main+0x1d>
mov    0x2e11(%rip),%rax
mov    (%rax),%rcx
movslq -0x8(%rbp),%rax
sub    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    0x2dfd(%rip),%rax
mov    (%rax),%rax
shl    $0x3,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    120b <main+0xbb>
mov    $0x0,%al
call   1050 <usage@plt>
jmp    1210 <main+0xc0>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x14(%rbp),%esi
call   1030 <do_touch@plt>
cmp    $0x0,%rax
je     1237 <main+0xe7>
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <err@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1210 <main+0xc0>
mov    $0x1,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xe9d(%rip),%r15
xor    %r14d,%r14d
jmp    1170 <main+0x20>
mov    $0x1,%r14d
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1060 <getopt@plt>
cmp    $0x63,%eax
je     1168 <main+0x18>
cmp    $0xffffffff,%eax
je     1190 <main+0x40>
xor    %eax,%eax
call   1050 <usage@plt>
jmp    1170 <main+0x20>
mov    0x2e51(%rip),%rax
mov    (%rax),%r15
cmp    %ebp,%r15d
jne    11a6 <main+0x56>
xor    %eax,%eax
call   1050 <usage@plt>
mov    (%rbx,%r15,8),%rdi
lea    (%rbx,%r15,8),%rbx
add    $0x8,%rbx
jmp    11cc <main+0x7c>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
je     11e7 <main+0x97>
mov    %r14d,%esi
call   1030 <do_touch@plt>
test   %rax,%rax
je     11c0 <main+0x70>
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <err@plt>
jmp    11c0 <main+0x70>
mov    $0x1,%edi
call   1070 <exit@plt>

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

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@optind = global i64 0
define i32 @main(i32 %0, i8** %1) {
br label %3
3: ; preds = %5, %2
%4 = phi i32 [ 0, %2 ], [ 1, %5 ]
br label %5
5: ; preds = %3, %7
%6 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
switch i32 %6, label %7 [
i32 -1, label %9
i32 99, label %3
]
7: ; preds = %5
%8 = tail call i32 (...) @usage()
br label %5
9: ; preds = %5
%10 = load i64, i64* @optind
%11 = trunc i64 %10 to i32
%12 = getelementptr inbounds i8*, i8** %1, i64 %10
%13 = icmp eq i32 %11, %0
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = tail call i32 (...) @usage()
br label %16
16: ; preds = %14, %9
%17 = load i8*, i8** %12
br label %18
18: ; preds = %25, %16
%19 = phi i8* [ %17, %16 ], [ %27, %25 ]
%20 = phi i8** [ %12, %16 ], [ %26, %25 ]
%21 = tail call i64 @do_touch(i8* %19, i32 %4)
%22 = icmp eq i64 %21, 0
br i1 %22, label %25, label %23
23: ; preds = %18
%24 = tail call i32 @err(i32 1, i32* null)
br label %25
25: ; preds = %23, %18
%26 = getelementptr inbounds i8*, i8** %20, i64 1
%27 = load i8*, i8** %26
%28 = icmp eq i8* %27, null
br i1 %28, label %29, label %18
29: ; preds = %25
%30 = tail call i32 @exit(i32 1)
unreachable
}