#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ free(char *);
int getline(char **, size_t *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char *line;
  size_t len;
  FILE *fp;
  int i;
  line = NULL;
  len = 0;
  for (i = 1; i < argc; i++) {
    fp = fopen(argv[i], "rt");
    if (!fp)
      continue;
    while (getline(&line, &len, fp) != -1)
      printf("%s", line);
    fclose(fp);
  }
  free(line);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movl   $0x1,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1200 <main+0xb0>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe64(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    11b5 <main+0x65>
jmp    11f2 <main+0xa2>
jmp    11ba <main+0x6a>
mov    -0x28(%rbp),%rdx
lea    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1070 <getline@plt>
cmp    $0xffffffff,%eax
je     11e9 <main+0x99>
mov    -0x18(%rbp),%rsi
lea    0xe24(%rip),%rdi
call   1050 <printf@plt>
jmp    11ba <main+0x6a>
mov    -0x28(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    117d <main+0x2d>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,0x8(%rsp)
movq   $0x0,(%rsp)
movq   $0x0,0x10(%rsp)
cmp    $0x2,%edi
jl     11f1 <main+0xa1>
mov    %edi,%r14d
mov    $0x1,%r15d
mov    %rsp,%r12
lea    0x10(%rsp),%rbx
lea    0xe72(%rip),%r13
jmp    11b1 <main+0x61>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbp,%rdi
call   1040 <fclose@plt>
add    $0x1,%r15
cmp    %r14,%r15
je     11f5 <main+0xa5>
mov    0x8(%rsp),%rax
mov    (%rax,%r15,8),%rdi
lea    0xe3f(%rip),%rsi
call   1060 <fopen@plt>
test   %rax,%rax
je     11a8 <main+0x58>
mov    %rax,%rbp
xchg   %ax,%ax
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
call   1070 <getline@plt>
cmp    $0xffffffff,%eax
je     11a0 <main+0x50>
mov    (%rsp),%rsi
mov    %r13,%rdi
call   1050 <printf@plt>
jmp    11d0 <main+0x80>
xor    %edi,%edi
jmp    11f9 <main+0xa9>
mov    (%rsp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"rt\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32*
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
store i64 0, i64* %7
store i32 1, i32* %9
br label %10
10: ; preds = %35, %2
%11 = load i32, i32* %9
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %38
14: ; preds = %10
%15 = load i8**, i8*** %5
%16 = load i32, i32* %9
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8*, i8** %15, i64 %17
%19 = load i8*, i8** %18
%20 = call i32* @fopen(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %20, i32** %8
%21 = load i32*, i32** %8
%22 = icmp ne i32* %21, null
br i1 %22, label %24, label %23
23: ; preds = %14
br label %35
24: ; preds = %14
br label %25
25: ; preds = %29, %24
%26 = load i32*, i32** %8
%27 = call i32 @getline(i8** %6, i64* %7, i32* %26)
%28 = icmp ne i32 %27, -1
br i1 %28, label %29, label %32
29: ; preds = %25
%30 = load i8*, i8** %6
%31 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %30)
br label %25
32: ; preds = %25
%33 = load i32*, i32** %8
%34 = call i32 @fclose(i32* %33)
br label %35
35: ; preds = %32, %23
%36 = load i32, i32* %9
%37 = add nsw i32 %36, 1
store i32 %37, i32* %9
br label %10
38: ; preds = %10
%39 = load i8*, i8** %6
%40 = call i32 @free(i8* %39)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"rt\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = bitcast i8** %3 to i8*
%6 = bitcast i64* %4 to i8*
store i8* null, i8** %3
store i64 0, i64* %4
%7 = icmp sgt i32 %0, 1
br i1 %7, label %8, label %31
8: ; preds = %2
%9 = zext i32 %0 to i64
br label %10
10: ; preds = %8, %26
%11 = phi i64 [ 1, %8 ], [ %27, %26 ]
%12 = getelementptr inbounds i8*, i8** %1, i64 %11
%13 = load i8*, i8** %12
%14 = call i32* @fopen(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%15 = icmp eq i32* %14, null
br i1 %15, label %26, label %16
16: ; preds = %10
%17 = call i32 @getline(i8** %3, i64* %4, i32* %14)
%18 = icmp eq i32 %17, -1
br i1 %18, label %24, label %19
19: ; preds = %16, %19
%20 = load i8*, i8** %3
%21 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %20)
%22 = call i32 @getline(i8** %3, i64* %4, i32* %14)
%23 = icmp eq i32 %22, -1
br i1 %23, label %24, label %19
24: ; preds = %19, %16
%25 = call i32 @fclose(i32* %14)
br label %26
26: ; preds = %10, %24
%27 = add nuw nsw i64 %11, 1
%28 = icmp eq i64 %27, %9
br i1 %28, label %29, label %10
29: ; preds = %26
%30 = load i8*, i8** %3
br label %31
31: ; preds = %29, %2
%32 = phi i8* [ %30, %29 ], [ null, %2 ]
%33 = call i32 @free(i8* %32)
ret i32 0
}