#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 *);
int /*<<< orphan*/ read_canned_config(char *);
char *strchr(char *, char);
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  argc--;
  argv++;
  if (argc > 1 && strcmp(argv[0], "-f") == 0) {
    read_canned_config(argv[1]);
    argc -= 2;
    argv += 2;
  }
  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   $0x1,-0x8(%rbp)
jle    11d4 <main+0x74>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe5d(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    11d4 <main+0x74>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <read_canned_config@plt>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    11ea <main+0x8a>
lea    0xe1e(%rip),%rdi
call   1070 <die@plt>
jmp    11ef <main+0x8f>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
jle    1266 <main+0x106>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0x3d,%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     123a <main+0xda>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x0,(%rax)
jmp    1245 <main+0xe5>
lea    0xddd(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rsi
call   1080 <archive@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    11ef <main+0x8f>
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
mov    %edi,%ebx
lea    -0x1(%rbx),%r15d
lea    0x8(%rsi),%rbp
cmp    $0x3,%edi
jl     11a4 <main+0x44>
mov    %rsi,%r14
mov    0x0(%rbp),%rdi
lea    0xe7c(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    11ab <main+0x4b>
mov    0x10(%r14),%rdi
call   1050 <read_canned_config@plt>
add    $0xfffffffd,%ebx
add    $0x18,%r14
mov    %ebx,%r15d
mov    %r14,%rbp
test   %r15d,%r15d
je     11ff <main+0x9f>
jle    120b <main+0xab>
add    $0x1,%r15d
lea    0xe68(%rip),%r14
jmp    11d6 <main+0x76>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1080 <archive@plt>
add    $0x8,%rbp
add    $0xffffffff,%r15d
cmp    $0x1,%r15d
jbe    120b <main+0xab>
mov    0x0(%rbp),%rbx
mov    %rbx,%rdi
mov    $0x3d,%esi
call   1040 <strchr@plt>
mov    %r14,%rsi
test   %rax,%rax
je     11c0 <main+0x60>
mov    %rax,%rsi
add    $0x1,%rsi
movb   $0x0,(%rax)
mov    0x0(%rbp),%rbx
jmp    11c0 <main+0x60>
lea    0xdfd(%rip),%rdi
call   1070 <die@plt>
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 = [3 x i8] c"-f\00"
@.str.1 = [28 x i8] c"no directories to process?!\00"
@.str.2 = [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 sgt i32 %11, 1
br i1 %12, label %13, label %28
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 0
%16 = load i8*, i8** %15
%17 = call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %28
19: ; preds = %13
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i32 @read_canned_config(i8* %22)
%24 = load i32, i32* %4
%25 = sub nsw i32 %24, 2
store i32 %25, i32* %4
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 2
store i8** %27, i8*** %5
br label %28
28: ; preds = %19, %13, %2
%29 = load i32, i32* %4
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = call i32 @die(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
br label %33
33: ; preds = %31, %28
br label %34
34: ; preds = %48, %33
%35 = load i32, i32* %4
%36 = add nsw i32 %35, -1
store i32 %36, i32* %4
%37 = icmp sgt i32 %35, 0
br i1 %37, label %38, label %55
38: ; preds = %34
%39 = load i8**, i8*** %5
%40 = load i8*, i8** %39
%41 = call i8* @strchr(i8* %40, i8 signext 61)
store i8* %41, i8** %6
%42 = load i8*, i8** %6
%43 = icmp ne i8* %42, null
br i1 %43, label %44, label %47
44: ; preds = %38
%45 = load i8*, i8** %6
%46 = getelementptr inbounds i8, i8* %45, i32 1
store i8* %46, i8** %6
store i8 0, i8* %45
br label %48
47: ; preds = %38
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8** %6
br label %48
48: ; preds = %47, %44
%49 = load i8**, i8*** %5
%50 = load i8*, i8** %49
%51 = load i8*, i8** %6
%52 = call i32 @archive(i8* %50, i8* %51)
%53 = load i8**, i8*** %5
%54 = getelementptr inbounds i8*, i8** %53, i32 1
store i8** %54, i8*** %5
br label %34
55: ; preds = %34
%56 = call i32 (...) @_eject_trailer()
ret i32 0
}

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