#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 /*<<< orphan*/ st_atime;
  scalar_t__ st_size;
  scalar_t__ st_gid;
  scalar_t__ st_uid;
  scalar_t__ st_ino;
};

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int stat(char *, struct stat *);
int main() {
  struct stat sb;
  int result;
  result = stat("./", &sb);
  if (result == -1) {
    printf("error\n");
  }
  printf("I-node number: %ld\n", (long int)sb.st_ino);
  printf("Ownership: UID=%ld, GID=%ld\n", (long int)sb.st_uid,
         (long int)sb.st_gid);
  printf("File size: %lld bytes\n", (long long int)sb.st_size);
  printf("Last file access: %s", ctime(&sb.st_atime));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x30(%rbp),%rsi
call   1050 <stat@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0xffffffff,-0x34(%rbp)
jne    116a <main+0x3a>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%rsi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,%rsi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
lea    0xeb5(%rip),%rdi
mov    %rsp,%rsi
call   1060 <stat@plt>
cmp    $0xffffffff,%eax
jne    1164 <main+0x24>
lea    0xf01(%rip),%rdi
call   1030 <puts@plt>
mov    0x20(%rsp),%rsi
lea    0xe93(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x10(%rsp),%rdx
mov    0x18(%rsp),%rsi
lea    0xe8f(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%rsi
lea    0xe99(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rsp,%rdi
call   1040 <ctime@plt>
lea    0xe9a(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.stat = type { i32, i64, i64, i64, i64 }
@.str = [3 x i8] c"./\00"
@.str.1 = [7 x i8] c"error\0A\00"
@.str.2 = [20 x i8] c"I-node number: %ld\0A\00"
@.str.3 = [29 x i8] c"Ownership: UID=%ld, GID=%ld\0A\00"
@.str.4 = [23 x i8] c"File size: %lld bytes\0A\00"
@.str.5 = [21 x i8] c"Last file access: %s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.stat
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @stat(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %struct.stat* %2)
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %0
%10 = getelementptr inbounds %struct.stat, %struct.stat* %2, i32 0, i32 4
%11 = load i64, i64* %10
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i64 %11)
%13 = getelementptr inbounds %struct.stat, %struct.stat* %2, i32 0, i32 3
%14 = load i64, i64* %13
%15 = getelementptr inbounds %struct.stat, %struct.stat* %2, i32 0, i32 2
%16 = load i64, i64* %15
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i64 %14, i64 %16)
%18 = getelementptr inbounds %struct.stat, %struct.stat* %2, i32 0, i32 1
%19 = load i64, i64* %18
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i64 %19)
%21 = getelementptr inbounds %struct.stat, %struct.stat* %2, i32 0, i32 0
%22 = call i8* @ctime(i32* %21)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %22)
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type { i32, i64, i64, i64, i64 }
@.str = [3 x i8] c"./\00"
@.str.2 = [20 x i8] c"I-node number: %ld\0A\00"
@.str.3 = [29 x i8] c"Ownership: UID=%ld, GID=%ld\0A\00"
@.str.4 = [23 x i8] c"File size: %lld bytes\0A\00"
@.str.5 = [21 x i8] c"Last file access: %s\00"
@str = [6 x i8] c"error\00"
define i32 @main() {
%1 = alloca %struct.stat
%2 = bitcast %struct.stat* %1 to i8*
%3 = call i32 @stat(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 4
%9 = load i64, i64* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i64 %9)
%11 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 3
%12 = load i64, i64* %11
%13 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 2
%14 = load i64, i64* %13
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i64 %12, i64 %14)
%16 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 1
%17 = load i64, i64* %16
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i64 %17)
%19 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
%20 = call i8* @ctime(i32* %19)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %20)
ret i32 0
}