#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*/ dumpdata(unsigned char *, size_t);
int /*<<< orphan*/ free(unsigned char *);
int /*<<< orphan*/ printf(char *, char *);
unsigned char *readentire(char *, size_t *, int /*<<< orphan*/, char *);
int main(int argc, char *argv[]) {
  int i;
  unsigned char *buff;
  size_t size;
  for (i = 1; i < argc; i++) {
    if ((buff = readentire(argv[i], &size, 0, argv[0])) != NULL) {
      printf("%s:\n", argv[i]);
      dumpdata(buff, size);
      free(buff);
    }
  }
  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)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11d6 <main+0x96>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
lea    -0x28(%rbp),%rsi
xor    %edx,%edx
call   1050 <readentire@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     11c3 <main+0x83>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe58(%rip),%rdi
call   1040 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1060 <dumpdata@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
jmp    11c8 <main+0x88>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    115d <main+0x1d>
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
push   %rax
cmp    $0x2,%edi
jl     11b5 <main+0x75>
mov    %rsi,%r12
mov    %edi,%r13d
mov    $0x1,%ebp
mov    %rsp,%r14
lea    0xe9b(%rip),%r15
jmp    1179 <main+0x39>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbp
cmp    %rbp,%r13
je     11b5 <main+0x75>
mov    (%r12,%rbp,8),%rdi
mov    (%r12),%rcx
mov    %r14,%rsi
xor    %edx,%edx
call   1050 <readentire@plt>
test   %rax,%rax
je     1170 <main+0x30>
mov    %rax,%rbx
mov    (%r12,%rbp,8),%rsi
mov    %r15,%rdi
call   1040 <printf@plt>
mov    (%rsp),%rsi
mov    %rbx,%rdi
call   1060 <dumpdata@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
jmp    1170 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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