#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*/ printf(char *);
int process_file(char *);
int main(int argc, char **argv) {
  int i;
  if (argc < 2) {
    printf("file or disk expected\n");
    return 1;
  }
  for (i = 1; i != argc; ++i) {
    int rc = process_file(argv[i]);
    if (rc)
      return rc;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1158 <main+0x38>
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11ae <main+0x8e>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     11a7 <main+0x87>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <process_file@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1194 <main+0x74>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11ae <main+0x8e>
jmp    1199 <main+0x79>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    115f <main+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jge    113d <main+0x1d>
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
jmp    1168 <main+0x48>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1040 <process_file@plt>
test   %eax,%eax
jne    1168 <main+0x48>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1150 <main+0x30>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@str = [22 x i8] c"file or disk expected\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %10
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
br label %17
8: ; preds = %10
%9 = icmp eq i64 %16, %5
br i1 %9, label %17, label %10
10: ; preds = %4, %8
%11 = phi i64 [ 1, %4 ], [ %16, %8 ]
%12 = getelementptr inbounds i8*, i8** %1, i64 %11
%13 = load i8*, i8** %12
%14 = tail call i32 @process_file(i8* %13)
%15 = icmp eq i32 %14, 0
%16 = add nuw nsw i64 %11, 1
br i1 %15, label %8, label %17
17: ; preds = %10, %8, %6
%18 = phi i32 [ 1, %6 ], [ %14, %10 ], [ 0, %8 ]
ret i32 %18
}