#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 question {
  int dummy;
};
typedef int /*<<< orphan*/ first;

/* Variables and functions */
struct question *parse_file(char *, struct question *);
struct question *xcalloc(int, int);
struct question *parse_all_files(char **files) {
  int i;
  struct question *first, *last;
  first = last = xcalloc(1, sizeof(first));
  for (i = 0; files[i]; i++)
    last = parse_file(files[i], last);
  return first;
}


x86 assembly (clang, -O0):
<parse_all_files>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
mov    $0x8,%esi
call   1040 <xcalloc@plt>
mov    %rax,-0x20(%rbp)
mov    %rax,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1184 <parse_all_files+0x64>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <parse_file@plt>
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114a <parse_all_files+0x2a>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_all_files>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x1,%edi
mov    $0x8,%esi
call   1040 <xcalloc@plt>
mov    %rax,%r14
mov    (%rbx),%rdi
test   %rdi,%rdi
je     1164 <parse_all_files+0x44>
add    $0x8,%rbx
mov    %r14,%rax
nopl   0x0(%rax,%rax,1)
mov    %rax,%rsi
call   1030 <parse_file@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1150 <parse_all_files+0x30>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.question = type { i32 }
define %struct.question* @parse_all_files(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
%4 = alloca %struct.question*
%5 = alloca %struct.question*
store i8** %0, i8*** %2
%6 = call %struct.question* @xcalloc(i32 1, i32 8)
store %struct.question* %6, %struct.question** %5
store %struct.question* %6, %struct.question** %4
store i32 0, i32* %3
br label %7
7: ; preds = %22, %1
%8 = load i8**, i8*** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8*, i8** %8, i64 %10
%12 = load i8*, i8** %11
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %25
14: ; preds = %7
%15 = load i8**, i8*** %2
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8*, i8** %15, i64 %17
%19 = load i8*, i8** %18
%20 = load %struct.question*, %struct.question** %5
%21 = call %struct.question* @parse_file(i8* %19, %struct.question* %20)
store %struct.question* %21, %struct.question** %5
br label %22
22: ; preds = %14
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %7
25: ; preds = %7
%26 = load %struct.question*, %struct.question** %4
ret %struct.question* %26
}

LLVM IR (-O2):
%struct.question = type { i32 }
define %struct.question* @parse_all_files(i8** nocapture %0) {
%2 = tail call %struct.question* @xcalloc(i32 1, i32 8)
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %14, label %5
5: ; preds = %1, %5
%6 = phi i64 [ %10, %5 ], [ 0, %1 ]
%7 = phi i8* [ %12, %5 ], [ %3, %1 ]
%8 = phi %struct.question* [ %9, %5 ], [ %2, %1 ]
%9 = tail call %struct.question* @parse_file(i8* %7, %struct.question* %8)
%10 = add nuw i64 %6, 1
%11 = getelementptr inbounds i8*, i8** %0, i64 %10
%12 = load i8*, i8** %11
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %5
14: ; preds = %5, %1
ret %struct.question* %2
}