#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*/ O_RDONLY;
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ concatenate(int /*<<< orphan*/, int);
int getopt(int, char **, char *);
int /*<<< orphan*/ open(int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ optind;
int main(int argc, char *argv[]) {
  int o, u;
  o = u = 0;
  while ((o = getopt(argc, argv, "u")) != -1)
    switch (o) {
    case 'u':
      u = 1;
      break;
    case '?':
      break;
    default:
      break;
    }
  argv += optind;
  argc -= optind;
  if (argc == 0)
    concatenate(STDIN_FILENO, u);
  while (*argv)
    concatenate(open(*argv++, O_RDONLY), u);
  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   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe9e(%rip),%rdx
call   1050 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     11b3 <main+0x83>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x3f,%eax
je     11a4 <main+0x74>
jmp    1187 <main+0x57>
mov    -0x1c(%rbp),%eax
sub    $0x75,%eax
jne    11a9 <main+0x79>
jmp    1198 <main+0x68>
movl   $0x1,-0x18(%rbp)
jmp    11ae <main+0x7e>
jmp    11ae <main+0x7e>
jmp    11ae <main+0x7e>
jmp    1154 <main+0x24>
mov    0x2e26(%rip),%rax
mov    (%rax),%rax
shl    $0x3,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e10(%rip),%rax
mov    (%rax),%rcx
movslq -0x8(%rbp),%rax
sub    %rcx,%rax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    11f8 <main+0xc8>
mov    0x2de2(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%esi
call   1030 <concatenate@plt>
jmp    11fd <main+0xcd>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     123c <main+0x10c>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %eax,%edi
mov    0x2dc2(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,%edi
mov    -0x18(%rbp),%esi
call   1030 <concatenate@plt>
jmp    11fd <main+0xcd>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %r14d,%r14d
lea    0xeba(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1050 <getopt@plt>
cmp    $0x75,%eax
je     1169 <main+0x39>
cmp    $0xffffffff,%eax
jne    1150 <main+0x20>
jmp    1171 <main+0x41>
mov    $0x1,%r14d
jmp    1150 <main+0x20>
mov    0x2e68(%rip),%rax
mov    (%rax),%r15
cmp    %ebp,%r15d
jne    1191 <main+0x61>
mov    0x2e49(%rip),%rax
mov    (%rax),%edi
mov    %r14d,%esi
call   1030 <concatenate@plt>
mov    (%rbx,%r15,8),%rdi
test   %rdi,%rdi
je     11ce <main+0x9e>
lea    (%rbx,%r15,8),%rbx
add    $0x8,%rbx
mov    0x2e3f(%rip),%rbp
nopl   0x0(%rax)
mov    0x0(%rbp),%esi
call   1040 <open@plt>
mov    %eax,%edi
mov    %r14d,%esi
call   1030 <concatenate@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    11b0 <main+0x80>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"u\00"
@optind = global i64 0
@STDIN_FILENO = global i32 0
@O_RDONLY = 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
store i32 0, i32* %7
store i32 0, i32* %6
br label %8
8: ; preds = %18, %2
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = call i32 @getopt(i32 %9, i8** %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 %11, i32* %6
%12 = icmp ne i32 %11, -1
br i1 %12, label %13, label %19
13: ; preds = %8
%14 = load i32, i32* %6
switch i32 %14, label %17 [
i32 117, label %15
i32 63, label %16
]
15: ; preds = %13
store i32 1, i32* %7
br label %18
16: ; preds = %13
br label %18
17: ; preds = %13
br label %18
18: ; preds = %17, %16, %15
br label %8
19: ; preds = %8
%20 = load i64, i64* @optind
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 %20
store i8** %22, i8*** %5
%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 i32, i32* %4
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %34
30: ; preds = %19
%31 = load i32, i32* @STDIN_FILENO
%32 = load i32, i32* %7
%33 = call i32 @concatenate(i32 %31, i32 %32)
br label %34
34: ; preds = %30, %19
br label %35
35: ; preds = %39, %34
%36 = load i8**, i8*** %5
%37 = load i8*, i8** %36
%38 = icmp ne i8* %37, null
br i1 %38, label %39, label %48
39: ; preds = %35
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i32 1
store i8** %41, i8*** %5
%42 = load i8*, i8** %40
%43 = ptrtoint i8* %42 to i32
%44 = load i32, i32* @O_RDONLY
%45 = call i32 @open(i32 %43, i32 %44)
%46 = load i32, i32* %7
%47 = call i32 @concatenate(i32 %45, i32 %46)
br label %35
48: ; preds = %35
ret i32 0
}

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