#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*/ strncpy(char *, char *, int);
void find_driver_info(char *ifname, char *driver, char *version, char *firmware,
                      char *bus, int len) {
  strncpy(driver, "Unavailable", len);
  strncpy(version, "Unavailable", len);
  strncpy(firmware, "Unavailable", len);
  strncpy(bus, "Unavailable", len);
  driver[len - 1] = 0;
  version[len - 1] = 0;
  firmware[len - 1] = 0;
  bus[len - 1] = 0;
  return;
}


x86 assembly (clang, -O0):
<find_driver_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x2c(%rbp),%edx
lea    0xec2(%rip),%rsi
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x2c(%rbp),%edx
lea    0xeaf(%rip),%rsi
call   1030 <strncpy@plt>
mov    -0x20(%rbp),%rdi
mov    -0x2c(%rbp),%edx
lea    0xe9c(%rip),%rsi
call   1030 <strncpy@plt>
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%edx
lea    0xe89(%rip),%rsi
call   1030 <strncpy@plt>
mov    -0x10(%rbp),%rax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x28(%rbp),%rax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_driver_info>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,%ebp
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%rbx
lea    0xecf(%rip),%r13
mov    %rsi,%rdi
mov    %r13,%rsi
mov    %r9d,%edx
call   1030 <strncpy@plt>
mov    %r12,%rdi
mov    %r13,%rsi
mov    %ebp,%edx
call   1030 <strncpy@plt>
mov    %r15,%rdi
mov    %r13,%rsi
mov    %ebp,%edx
call   1030 <strncpy@plt>
mov    %r14,%rdi
mov    %r13,%rsi
mov    %ebp,%edx
call   1030 <strncpy@plt>
movslq %ebp,%rax
movb   $0x0,-0x1(%rbx,%rax,1)
movb   $0x0,-0x1(%r12,%rax,1)
movb   $0x0,-0x1(%r15,%rax,1)
movb   $0x0,-0x1(%r14,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Unavailable\00"
define void @find_driver_info(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i32 %5, i32* %12
%13 = load i8*, i8** %8
%14 = load i32, i32* %12
%15 = call i32 @strncpy(i8* %13, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = load i8*, i8** %9
%17 = load i32, i32* %12
%18 = call i32 @strncpy(i8* %16, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = load i8*, i8** %10
%20 = load i32, i32* %12
%21 = call i32 @strncpy(i8* %19, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = load i8*, i8** %11
%23 = load i32, i32* %12
%24 = call i32 @strncpy(i8* %22, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %23)
%25 = load i8*, i8** %8
%26 = load i32, i32* %12
%27 = sub nsw i32 %26, 1
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %25, i64 %28
store i8 0, i8* %29
%30 = load i8*, i8** %9
%31 = load i32, i32* %12
%32 = sub nsw i32 %31, 1
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8, i8* %30, i64 %33
store i8 0, i8* %34
%35 = load i8*, i8** %10
%36 = load i32, i32* %12
%37 = sub nsw i32 %36, 1
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8, i8* %35, i64 %38
store i8 0, i8* %39
%40 = load i8*, i8** %11
%41 = load i32, i32* %12
%42 = sub nsw i32 %41, 1
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i8, i8* %40, i64 %43
store i8 0, i8* %44
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Unavailable\00"
define void @find_driver_info(i8* nocapture readnone %0, i8* %1, i8* %2, i8* %3, i8* %4, i32 %5) {
%7 = tail call i32 @strncpy(i8* %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5)
%8 = tail call i32 @strncpy(i8* %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5)
%9 = tail call i32 @strncpy(i8* %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5)
%10 = tail call i32 @strncpy(i8* %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5)
%11 = add nsw i32 %5, -1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %1, i64 %12
store i8 0, i8* %13
%14 = getelementptr inbounds i8, i8* %2, i64 %12
store i8 0, i8* %14
%15 = getelementptr inbounds i8, i8* %3, i64 %12
store i8 0, i8* %15
%16 = getelementptr inbounds i8, i8* %4, i64 %12
store i8 0, i8* %16
ret void
}