#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 */
struct node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ outputnode(struct node *, int /*<<< orphan*/);
struct node *parse();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ processcomments(struct node *);
int /*<<< orphan*/ readinput(char const *const *);
void processfiles(const char *const *names, int dtdref) {
  struct node *root;
  readinput(names);
  root = parse();
  processcomments(root);
  printf("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
  if (dtdref)
    printf("<!DOCTYPE Definitions SYSTEM \"widlprocxml.dtd\">\n");
  outputnode(root, 0);
}


x86 assembly (clang, -O0):
<processfiles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <readinput@plt>
mov    $0x0,%al
call   1070 <parse@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <processcomments@plt>
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
je     119e <processfiles+0x4e>
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1050 <outputnode@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processfiles>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1040 <readinput@plt>
xor    %eax,%eax
call   1070 <parse@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1060 <processcomments@plt>
lea    0xe8d(%rip),%rdi
call   1030 <puts@plt>
test   %ebp,%ebp
je     1188 <processfiles+0x38>
lea    0xea4(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
xor    %esi,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <outputnode@plt>

LLVM IR (-O0):
%struct.node = type { i32 }
@.str = [40 x i8] c"<?xml version=\221.0\22 encoding=\22UTF-8\22?>\0A\00"
@.str.1 = [49 x i8] c"<!DOCTYPE Definitions SYSTEM \22widlprocxml.dtd\22>\0A\00"
define void @processfiles(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = alloca %struct.node*
store i8** %0, i8*** %3
store i32 %1, i32* %4
%6 = load i8**, i8*** %3
%7 = call i32 @readinput(i8** %6)
%8 = call %struct.node* (...) @parse()
store %struct.node* %8, %struct.node** %5
%9 = load %struct.node*, %struct.node** %5
%10 = call i32 @processcomments(%struct.node* %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %14, %2
%17 = load %struct.node*, %struct.node** %5
%18 = call i32 @outputnode(%struct.node* %17, i32 0)
ret void
}

LLVM IR (-O2):
%struct.node = type { i32 }
@str = [39 x i8] c"<?xml version=\221.0\22 encoding=\22UTF-8\22?>\00"
@str.2 = [48 x i8] c"<!DOCTYPE Definitions SYSTEM \22widlprocxml.dtd\22>\00"
define void @processfiles(i8** %0, i32 %1) {
%3 = tail call i32 @readinput(i8** %0)
%4 = tail call %struct.node* (...) @parse()
%5 = tail call i32 @processcomments(%struct.node* %4)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%7 = icmp eq i32 %1, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = tail call i32 @outputnode(%struct.node* %4, i32 0)
ret void
}