#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 stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int lstat(char *, struct stat *);
int /*<<< orphan*/ stderr;
void verify_paths(char *list[]) {
  int i = 0;
  struct stat f;
  while (list[i]) {
    if (lstat(list[i], &f) == -1)
      fprintf(stderr, "verify not found: %s", list[i]);
    i++;
  }
}


x86 assembly (clang, -O0):
<verify_paths>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1193 <verify_paths+0x73>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <lstat@plt>
cmp    $0xffffffff,%eax
jne    1185 <verify_paths+0x65>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xe80(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <verify_paths+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_paths>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     117b <verify_paths+0x5b>
add    $0x8,%rbx
mov    %rsp,%r14
mov    0x2e9f(%rip),%r12
lea    0xeb8(%rip),%r15
jmp    115c <verify_paths+0x3c>
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
je     117b <verify_paths+0x5b>
mov    %r14,%rsi
call   1030 <lstat@plt>
cmp    $0xffffffff,%eax
jne    1150 <verify_paths+0x30>
mov    (%r12),%edi
mov    -0x8(%rbx),%rdx
mov    %r15,%rsi
call   1040 <fprintf@plt>
jmp    1150 <verify_paths+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [21 x i8] c"verify not found: %s\00"
define void @verify_paths(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
%4 = alloca %struct.stat
store i8** %0, i8*** %2
store i32 0, i32* %3
br label %5
5: ; preds = %28, %1
%6 = load i8**, i8*** %2
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8*, i8** %6, i64 %8
%10 = load i8*, i8** %9
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %31
12: ; preds = %5
%13 = load i8**, i8*** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 @lstat(i8* %17, %struct.stat* %4)
%19 = icmp eq i32 %18, -1
br i1 %19, label %20, label %28
20: ; preds = %12
%21 = load i32, i32* @stderr
%22 = load i8**, i8*** %2
%23 = load i32, i32* %3
%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 ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %26)
br label %28
28: ; preds = %20, %12
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 1
store i32 %30, i32* %3
br label %5
31: ; preds = %5
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [21 x i8] c"verify not found: %s\00"
define void @verify_paths(i8** nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %21, label %6
6: ; preds = %1, %16
%7 = phi i64 [ %17, %16 ], [ 0, %1 ]
%8 = phi i8* [ %19, %16 ], [ %4, %1 ]
%9 = phi i8** [ %18, %16 ], [ %0, %1 ]
%10 = call i32 @lstat(i8* %8, %struct.stat* %2)
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %16
12: ; preds = %6
%13 = load i32, i32* @stderr
%14 = load i8*, i8** %9
%15 = tail call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %12, %6
%17 = add nuw i64 %7, 1
%18 = getelementptr inbounds i8*, i8** %0, i64 %17
%19 = load i8*, i8** %18
%20 = icmp eq i8* %19, null
br i1 %20, label %21, label %6
21: ; preds = %16, %1
ret void
}