#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*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ process_template(char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ usage();
int main(int argc, char **argv) {
  argc--;
  argv++;
  if (argc == 0 || ((argc & 1) != 0))
    usage();
  do {
    fprintf(stderr, "processing template file %s\n", argv[0]);
    process_template(argv[0], argv[1]);
    argc -= 2;
    argv += 2;
  } while (argc > 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%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)
je     1174 <main+0x44>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     117b <main+0x4b>
mov    $0x0,%al
call   1050 <usage@plt>
jmp    1180 <main+0x50>
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe69(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <process_template@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)
jg     1180 <main+0x50>
xor    %eax,%eax
add    $0x10,%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
mov    %edi,%eax
add    $0xffffffff,%eax
je     1148 <main+0x18>
and    $0x1,%eax
je     114f <main+0x1f>
xor    %eax,%eax
call   1050 <usage@plt>
add    $0x8,%rbx
add    $0x1,%ebp
mov    0x2e83(%rip),%r15
lea    0xe9c(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r15),%edi
mov    (%rbx),%rdx
mov    %r14,%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%rdi
mov    0x8(%rbx),%rsi
call   1030 <process_template@plt>
add    $0xfffffffe,%ebp
add    $0x10,%rbx
cmp    $0x2,%ebp
jg     1170 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"processing template file %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = add nsw i32 %6, -1
store i32 %7, i32* %4
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i32 1
store i8** %9, i8*** %5
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %2
%13 = load i32, i32* %4
%14 = and i32 %13, 1
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %12, %2
%17 = call i32 (...) @usage()
br label %18
18: ; preds = %16, %12
br label %19
19: ; preds = %36, %18
%20 = load i32, i32* @stderr
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 0
%23 = load i8*, i8** %22
%24 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %23)
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 0
%27 = load i8*, i8** %26
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = call i32 @process_template(i8* %27, i8* %30)
%32 = load i32, i32* %4
%33 = sub nsw i32 %32, 2
store i32 %33, i32* %4
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 2
store i8** %35, i8*** %5
br label %36
36: ; preds = %19
%37 = load i32, i32* %4
%38 = icmp sgt i32 %37, 0
br i1 %38, label %19, label %39
39: ; preds = %36
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"processing template file %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = add nsw i32 %0, -1
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = icmp ne i32 %3, 0
%6 = and i32 %3, 1
%7 = icmp eq i32 %6, 0
%8 = and i1 %5, %7
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = tail call i32 (...) @usage()
br label %11
11: ; preds = %2, %9
br label %12
12: ; preds = %11, %12
%13 = phi i32 [ %22, %12 ], [ %3, %11 ]
%14 = phi i8** [ %23, %12 ], [ %4, %11 ]
%15 = load i32, i32* @stderr
%16 = load i8*, i8** %14
%17 = tail call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %16)
%18 = load i8*, i8** %14
%19 = getelementptr inbounds i8*, i8** %14, i64 1
%20 = load i8*, i8** %19
%21 = tail call i32 @process_template(i8* %18, i8* %20)
%22 = add nsw i32 %13, -2
%23 = getelementptr inbounds i8*, i8** %14, i64 2
%24 = icmp sgt i32 %13, 2
br i1 %24, label %12, label %25
25: ; preds = %12
ret i32 0
}