#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 st_uid;
  int st_gid;
  int st_blksize;
  int st_blocks;
  int st_size;
  int st_dev;
  int st_ino;
  int st_mode;
  int st_nlink;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stat(char *, struct stat *);
int main(int argc, char **argv) {
  struct stat buf;
  if (argc < 2) {
    printf("the must most argc,the current argc is %d\n", argc);
    exit(1);
  }
  stat(argv[1], &buf);
  printf("uid %d gid %d\n", buf.st_uid, buf.st_gid);
  printf("blksize %d blocks %d\n", buf.st_blksize, buf.st_blocks);
  printf("file[%s] size is %d the dev %d \n", argv[1], buf.st_size, buf.st_dev);
  printf("inode number %d\n", buf.st_ino);
  printf("protection %d\n", buf.st_mode);
  printf("number of hard links %d\n", buf.st_nlink);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    116b <main+0x3b>
mov    -0x8(%rbp),%esi
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x38(%rbp),%rsi
call   1040 <stat@plt>
mov    -0x38(%rbp),%esi
mov    -0x34(%rbp),%edx
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%esi
mov    -0x2c(%rbp),%edx
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x28(%rbp),%edx
mov    -0x24(%rbp),%ecx
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
cmp    $0x1,%edi
jle    11d3 <main+0xa3>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0x8(%rsp),%rsi
call   1040 <stat@plt>
mov    0x8(%rsp),%esi
mov    0xc(%rsp),%edx
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%esi
mov    0x14(%rsp),%edx
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rbx),%rsi
mov    0x18(%rsp),%edx
mov    0x1c(%rsp),%ecx
lea    0xec2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x20(%rsp),%esi
lea    0xed1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x24(%rsp),%esi
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x28(%rsp),%esi
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret
mov    %edi,%esi
lea    0xe24(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32, i32, i32, i32, i32, i32, i32, i32, i32 }
@.str = [43 x i8] c"the must most argc,the current argc is %d\0A\00"
@.str.1 = [15 x i8] c"uid %d gid %d\0A\00"
@.str.2 = [22 x i8] c"blksize %d blocks %d\0A\00"
@.str.3 = [33 x i8] c"file[%s] size is %d the dev %d \0A\00"
@.str.4 = [17 x i8] c"inode number %d\0A\00"
@.str.5 = [15 x i8] c"protection %d\0A\00"
@.str.6 = [25 x i8] c"number of hard links %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.stat
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %4
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @stat(i8* %16, %struct.stat* %6)
%18 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%19 = load i32, i32* %18
%20 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 1
%21 = load i32, i32* %20
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %19, i32 %21)
%23 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 2
%24 = load i32, i32* %23
%25 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 3
%26 = load i32, i32* %25
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %24, i32 %26)
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 4
%32 = load i32, i32* %31
%33 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 5
%34 = load i32, i32* %33
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i8* %30, i32 %32, i32 %34)
%36 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 6
%37 = load i32, i32* %36
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 %37)
%39 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 7
%40 = load i32, i32* %39
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %40)
%42 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 8
%43 = load i32, i32* %42
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i32 %43)
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type { i32, i32, i32, i32, i32, i32, i32, i32, i32 }
@.str = [43 x i8] c"the must most argc,the current argc is %d\0A\00"
@.str.1 = [15 x i8] c"uid %d gid %d\0A\00"
@.str.2 = [22 x i8] c"blksize %d blocks %d\0A\00"
@.str.3 = [33 x i8] c"file[%s] size is %d the dev %d \0A\00"
@.str.4 = [17 x i8] c"inode number %d\0A\00"
@.str.5 = [15 x i8] c"protection %d\0A\00"
@.str.6 = [25 x i8] c"number of hard links %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.stat
%4 = bitcast %struct.stat* %3 to i8*
%5 = icmp slt i32 %0, 2
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %0)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @stat(i8* %11, %struct.stat* %3)
%13 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%14 = load i32, i32* %13
%15 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 1
%16 = load i32, i32* %15
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %16)
%18 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 2
%19 = load i32, i32* %18
%20 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 3
%21 = load i32, i32* %20
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %19, i32 %21)
%23 = load i8*, i8** %10
%24 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 4
%25 = load i32, i32* %24
%26 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 5
%27 = load i32, i32* %26
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i8* %23, i32 %25, i32 %27)
%29 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 6
%30 = load i32, i32* %29
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i32 %30)
%32 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 7
%33 = load i32, i32* %32
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %33)
%35 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 8
%36 = load i32, i32* %35
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i32 %36)
ret i32 0
}