#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
scalar_t__ tst_check_driver(char const *);
int main(int argc, const char *argv[]) {
  const char *name;
  int i;
  if (argc < 2) {
    fprintf(stderr, "Please provide kernel driver list\n");
    return 1;
  }
  for (i = 1; (name = argv[i]); ++i) {
    if (tst_check_driver(name)) {
      fprintf(stderr, "%s", name);
      return 1;
    }
  }
  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    1163 <main+0x43>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11d8 <main+0xb8>
movl   $0x1,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     11d1 <main+0xb1>
mov    -0x18(%rbp),%rdi
call   1040 <tst_check_driver@plt>
cmp    $0x0,%rax
je     11be <main+0x9e>
mov    0x2e42(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xe78(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11d8 <main+0xb8>
jmp    11c3 <main+0xa3>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    116a <main+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%edi
jge    1142 <main+0x22>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
jmp    1196 <main+0x76>
mov    %rsi,%rbp
mov    0x8(%rsi),%rbx
xor    %r14d,%r14d
test   %rbx,%rbx
je     119c <main+0x7c>
add    $0x10,%rbp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
call   1040 <tst_check_driver@plt>
test   %rax,%rax
jne    117c <main+0x5c>
mov    0x0(%rbp),%rbx
add    $0x8,%rbp
test   %rbx,%rbx
jne    1160 <main+0x40>
jmp    119c <main+0x7c>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
lea    0xe97(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"Please provide kernel driver list\0A\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 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 %13
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %34
13: ; preds = %2
store i32 1, i32* %7
br label %14
14: ; preds = %30, %13
%15 = load i8**, i8*** %5
%16 = load i32, i32* %7
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8*, i8** %15, i64 %17
%19 = load i8*, i8** %18
store i8* %19, i8** %6
%20 = icmp ne i8* %19, null
br i1 %20, label %21, label %33
21: ; preds = %14
%22 = load i8*, i8** %6
%23 = call i64 @tst_check_driver(i8* %22)
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %29
25: ; preds = %21
%26 = load i32, i32* @stderr
%27 = load i8*, i8** %6
%28 = call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %27)
store i32 1, i32* %3
br label %34
29: ; preds = %21
br label %30
30: ; preds = %29
%31 = load i32, i32* %7
%32 = add nsw i32 %31, 1
store i32 %32, i32* %7
br label %14
33: ; preds = %14
store i32 0, i32* %3
br label %34
34: ; preds = %33, %25, %10
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"Please provide kernel driver list\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
br i1 %7, label %24, label %15
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %24
11: ; preds = %15
%12 = getelementptr inbounds i8*, i8** %1, i64 %20
%13 = load i8*, i8** %12
%14 = icmp eq i8* %13, null
br i1 %14, label %24, label %15
15: ; preds = %4, %11
%16 = phi i64 [ %20, %11 ], [ 1, %4 ]
%17 = phi i8* [ %13, %11 ], [ %6, %4 ]
%18 = tail call i64 @tst_check_driver(i8* %17)
%19 = icmp eq i64 %18, 0
%20 = add nuw i64 %16, 1
br i1 %19, label %11, label %21
21: ; preds = %15
%22 = load i32, i32* @stderr
%23 = tail call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %17)
br label %24
24: ; preds = %11, %4, %21, %8
%25 = phi i32 [ 1, %8 ], [ 1, %21 ], [ 0, %4 ], [ 0, %11 ]
ret i32 %25
}