#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*/ FindResourceFile(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  int i, ret = 0;
  for (i = 1; i < argc; ++i)
    if (!FindResourceFile(argv[i])) {
      fprintf(stderr, "Can't find an appropriate resource fork in %s\n",
              argv[i]);
      ret = 1;
    }
  return (ret);
}


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)
movl   $0x0,-0x18(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11a5 <main+0x85>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <FindResourceFile@plt>
cmp    $0x0,%eax
jne    1192 <main+0x72>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xe7a(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x1,-0x18(%rbp)
jmp    1197 <main+0x77>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1144 <main+0x24>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %r15d,%r15d
cmp    $0x2,%edi
jl     118e <main+0x6e>
mov    %rsi,%rbx
mov    %edi,%r12d
xor    %r15d,%r15d
mov    $0x1,%ebp
mov    0x2e98(%rip),%r13
lea    0xeb1(%rip),%r14
jmp    1169 <main+0x49>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbp
cmp    %rbp,%r12
je     118e <main+0x6e>
mov    (%rbx,%rbp,8),%rdi
call   1040 <FindResourceFile@plt>
test   %eax,%eax
jne    1160 <main+0x40>
mov    0x0(%r13),%edi
mov    (%rbx,%rbp,8),%rdx
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    $0x1,%r15d
jmp    1160 <main+0x40>
mov    %r15d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [47 x i8] c"Can't find an appropriate resource fork in %s\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
store i32 0, i32* %7
store i32 1, i32* %6
br label %8
8: ; preds = %29, %2
%9 = load i32, i32* %6
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %32
12: ; preds = %8
%13 = load i8**, i8*** %5
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 @FindResourceFile(i8* %17)
%19 = icmp ne i32 %18, 0
br i1 %19, label %28, label %20
20: ; preds = %12
%21 = load i32, i32* @stderr
%22 = load i8**, i8*** %5
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8*, i8** %22, i64 %24
%26 = load i8*, i8** %25
%27 = call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %26)
store i32 1, i32* %7
br label %28
28: ; preds = %20, %12
br label %29
29: ; preds = %28
%30 = load i32, i32* %6
%31 = add nsw i32 %30, 1
store i32 %31, i32* %6
br label %8
32: ; preds = %8
%33 = load i32, i32* %7
ret i32 %33
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"Can't find an appropriate resource fork in %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %21
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %17
%7 = phi i64 [ 1, %4 ], [ %19, %17 ]
%8 = phi i32 [ 0, %4 ], [ %18, %17 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %7
%10 = load i8*, i8** %9
%11 = tail call i32 @FindResourceFile(i8* %10)
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %6
%14 = load i32, i32* @stderr
%15 = load i8*, i8** %9
%16 = tail call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %6, %13
%18 = phi i32 [ %8, %6 ], [ 1, %13 ]
%19 = add nuw nsw i64 %7, 1
%20 = icmp eq i64 %19, %5
br i1 %20, label %21, label %6
21: ; preds = %17, %2
%22 = phi i32 [ 0, %2 ], [ %18, %17 ]
ret i32 %22
}