#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_ctime;
  int /*<<< orphan*/ st_mtime;
  int /*<<< orphan*/ st_atime;
};

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stat(char *, struct stat *);
void main() {
  struct stat sb;
  stat("foo", &sb);
  printf("last accessed: %s", ctime(&sb.st_atime));
  printf("last modified: %s", ctime(&sb.st_mtime));
  printf("last change:   %s", ctime(&sb.st_ctime));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <stat@plt>
lea    -0x10(%rbp),%rdi
add    $0x8,%rdi
call   1030 <ctime@plt>
mov    %rax,%rsi
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
lea    -0x10(%rbp),%rdi
add    $0x4,%rdi
call   1030 <ctime@plt>
mov    %rax,%rsi
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
lea    -0x10(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,%rsi
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <stat@plt>
lea    0x8(%rsp),%rdi
call   1030 <ctime@plt>
lea    0xeac(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
lea    0x4(%rsp),%rdi
call   1030 <ctime@plt>
lea    0xea5(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <ctime@plt>
lea    0xea0(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32, i32, i32 }
@.str = [4 x i8] c"foo\00"
@.str.1 = [18 x i8] c"last accessed: %s\00"
@.str.2 = [18 x i8] c"last modified: %s\00"
@.str.3 = [18 x i8] c"last change: %s\00"
define void @main() {
%1 = alloca %struct.stat
%2 = call i32 @stat(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
%3 = getelementptr inbounds %struct.stat, %struct.stat* %1, i32 0, i32 2
%4 = call i8* @ctime(i32* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %1, i32 0, i32 1
%7 = call i8* @ctime(i32* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds %struct.stat, %struct.stat* %1, i32 0, i32 0
%10 = call i8* @ctime(i32* %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %10)
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32, i32, i32 }
@.str = [4 x i8] c"foo\00"
@.str.1 = [18 x i8] c"last accessed: %s\00"
@.str.2 = [18 x i8] c"last modified: %s\00"
@.str.3 = [18 x i8] c"last change: %s\00"
define void @main() {
%1 = alloca %struct.stat
%2 = bitcast %struct.stat* %1 to i8*
%3 = call i32 @stat(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
%4 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 2
%5 = call i8* @ctime(i32* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 1
%8 = call i8* @ctime(i32* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
%11 = call i8* @ctime(i32* %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %11)
ret void
}