#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 test(char *);
int main(int argc, char **argv) {
  int retval = 0;
  --argc;
  ++argv;
  if (argc == 0)
    retval = test(".");
  else
    while (argc-- > 0)
      retval |= test(*argv++);
  return retval;
}


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),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1160 <main+0x50>
lea    0xead(%rip),%rdi
call   1030 <test@plt>
mov    %eax,-0x14(%rbp)
jmp    11a0 <main+0x90>
jmp    1165 <main+0x55>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
jle    119b <main+0x8b>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rdi
call   1030 <test@plt>
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1165 <main+0x55>
jmp    11a0 <main+0x90>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x1,%edi
je     114f <main+0x3f>
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebp
xor    %r14d,%r14d
cmp    $0x2,%edi
jl     1147 <main+0x37>
mov    %rsi,%rbx
add    $0x8,%rbx
xor    %r14d,%r14d
nopl   (%rax)
mov    (%rbx),%rdi
call   1030 <test@plt>
or     %eax,%r14d
add    $0x8,%rbx
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1130 <main+0x20>
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
lea    0xeaa(%rip),%rdi
jmp    1030 <test@plt>

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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = load i32, i32* %4
%8 = add nsw i32 %7, -1
store i32 %8, i32* %4
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i32 1
store i8** %10, i8*** %5
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 %14, i32* %6
br label %28
15: ; preds = %2
br label %16
16: ; preds = %20, %15
%17 = load i32, i32* %4
%18 = add nsw i32 %17, -1
store i32 %18, i32* %4
%19 = icmp sgt i32 %17, 0
br i1 %19, label %20, label %27
20: ; preds = %16
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i32 1
store i8** %22, i8*** %5
%23 = load i8*, i8** %21
%24 = call i32 @test(i8* %23)
%25 = load i32, i32* %6
%26 = or i32 %25, %24
store i32 %26, i32* %6
br label %16
27: ; preds = %16
br label %28
28: ; preds = %27, %13
%29 = load i32, i32* %6
ret i32 %29
}

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