#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 process(char *);
int main(int argc, char *argv[]) {
  int i;
  int errs = 0;
  if (argc == 1)
    errs = process("-");
  else
    for (i = 1; i < argc; i++)
      errs += process(argv[i]);
  return (errs != 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)
cmpl   $0x1,-0x8(%rbp)
jne    114b <main+0x3b>
lea    0xec2(%rip),%rdi
call   1030 <process@plt>
mov    %eax,-0x18(%rbp)
jmp    1188 <main+0x78>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1183 <main+0x73>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <process@plt>
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1152 <main+0x42>
jmp    1188 <main+0x78>
cmpl   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x1,%edi
jne    112c <main+0x1c>
lea    0xedd(%rip),%rdi
call   1030 <process@plt>
mov    %eax,%ebp
jmp    1154 <main+0x44>
xor    %ebp,%ebp
cmp    $0x2,%edi
jl     1154 <main+0x44>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebp,%ebp
mov    $0x1,%ebx
mov    (%r14,%rbx,8),%rdi
call   1030 <process@plt>
add    %eax,%ebp
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <main+0x30>
xor    %eax,%eax
test   %ebp,%ebp
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"-\00"
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
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @process(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 %11, i32* %7
br label %30
12: ; preds = %2
store i32 1, i32* %6
br label %13
13: ; preds = %26, %12
%14 = load i32, i32* %6
%15 = load i32, i32* %4
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %29
17: ; preds = %13
%18 = load i8**, i8*** %5
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8*, i8** %18, i64 %20
%22 = load i8*, i8** %21
%23 = call i32 @process(i8* %22)
%24 = load i32, i32* %7
%25 = add nsw i32 %24, %23
store i32 %25, i32* %7
br label %26
26: ; preds = %17
%27 = load i32, i32* %6
%28 = add nsw i32 %27, 1
store i32 %28, i32* %6
br label %13
29: ; preds = %13
br label %30
30: ; preds = %29, %10
%31 = load i32, i32* %7
%32 = icmp ne i32 %31, 0
%33 = zext i1 %32 to i32
ret i32 %33
}

LLVM IR (-O2):
@.str = [2 x i8] c"-\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %19
6: ; preds = %4
%7 = zext i32 %0 to i64
br label %10
8: ; preds = %2
%9 = tail call i32 @process(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %19
10: ; preds = %6, %10
%11 = phi i64 [ 1, %6 ], [ %17, %10 ]
%12 = phi i32 [ 0, %6 ], [ %16, %10 ]
%13 = getelementptr inbounds i8*, i8** %1, i64 %11
%14 = load i8*, i8** %13
%15 = tail call i32 @process(i8* %14)
%16 = add nsw i32 %15, %12
%17 = add nuw nsw i64 %11, 1
%18 = icmp eq i64 %17, %7
br i1 %18, label %19, label %10
19: ; preds = %10, %4, %8
%20 = phi i32 [ %9, %8 ], [ 0, %4 ], [ %16, %10 ]
%21 = icmp ne i32 %20, 0
%22 = zext i1 %21 to i32
ret i32 %22
}