#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*/ _eject_trailer();
int /*<<< orphan*/ archive(char *, char *);
int /*<<< orphan*/ die(char *);
char *strchr(char *, char);
int main(int argc, char *argv[]) {
  argc--;
  argv++;
  if (argc == 0)
    die("no directories to process?!");
  while (argc-- > 0) {
    char *x = strchr(*argv, '=');
    if (x != 0) {
      *x++ = 0;
    } else {
      x = "";
    }
    archive(*argv, x);
    argv++;
  }
  _eject_trailer();
  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)
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    1181 <main+0x41>
lea    0xe84(%rip),%rdi
call   1050 <die@plt>
jmp    1186 <main+0x46>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
jle    11fd <main+0xbd>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0x3d,%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     11d1 <main+0x91>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x0,(%rax)
jmp    11dc <main+0x9c>
lea    0xe43(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <archive@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1186 <main+0x46>
mov    $0x0,%al
call   1030 <_eject_trailer@plt>
xor    %eax,%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    115a <main+0x1a>
lea    0xead(%rip),%rdi
call   1050 <die@plt>
jmp    11ba <main+0x7a>
jle    11ba <main+0x7a>
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0xffffffff,%ebp
add    $0x8,%rbx
lea    0xeac(%rip),%r15
jmp    1193 <main+0x53>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1060 <archive@plt>
add    $0xffffffff,%ebp
add    $0x8,%rbx
test   %ebp,%ebp
jle    11ba <main+0x7a>
mov    (%rbx),%r14
mov    %r14,%rdi
mov    $0x3d,%esi
call   1040 <strchr@plt>
mov    %r15,%rsi
test   %rax,%rax
je     1180 <main+0x40>
mov    %rax,%rsi
add    $0x1,%rsi
movb   $0x0,(%rax)
mov    (%rbx),%r14
jmp    1180 <main+0x40>
xor    %eax,%eax
call   1030 <_eject_trailer@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"no directories to process?!\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%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 @die(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %2
br label %16
16: ; preds = %30, %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 %37
20: ; preds = %16
%21 = load i8**, i8*** %5
%22 = load i8*, i8** %21
%23 = call i8* @strchr(i8* %22, i8 signext 61)
store i8* %23, i8** %6
%24 = load i8*, i8** %6
%25 = icmp ne i8* %24, null
br i1 %25, label %26, label %29
26: ; preds = %20
%27 = load i8*, i8** %6
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %6
store i8 0, i8* %27
br label %30
29: ; preds = %20
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8** %6
br label %30
30: ; preds = %29, %26
%31 = load i8**, i8*** %5
%32 = load i8*, i8** %31
%33 = load i8*, i8** %6
%34 = call i32 @archive(i8* %32, i8* %33)
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i32 1
store i8** %36, i8*** %5
br label %16
37: ; preds = %16
%38 = call i32 (...) @_eject_trailer()
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"no directories to process?!\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @die(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %26
6: ; preds = %2
%7 = icmp sgt i32 %0, 1
br i1 %7, label %8, label %26
8: ; preds = %6
%9 = add nsw i32 %0, -2
br label %10
10: ; preds = %8, %20
%11 = phi i32 [ %24, %20 ], [ %9, %8 ]
%12 = phi i8** [ %13, %20 ], [ %1, %8 ]
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = tail call i8* @strchr(i8* dereferenceable(1) %14, i8 signext 61)
%16 = icmp eq i8* %15, null
br i1 %16, label %20, label %17
17: ; preds = %10
%18 = getelementptr inbounds i8, i8* %15, i64 1
store i8 0, i8* %15
%19 = load i8*, i8** %13
br label %20
20: ; preds = %10, %17
%21 = phi i8* [ %19, %17 ], [ %14, %10 ]
%22 = phi i8* [ %18, %17 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %10 ]
%23 = tail call i32 @archive(i8* %21, i8* %22)
%24 = add nsw i32 %11, -1
%25 = icmp sgt i32 %11, 0
br i1 %25, label %10, label %26
26: ; preds = %20, %4, %6
%27 = tail call i32 (...) @_eject_trailer()
ret i32 0
}