#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 */
typedef scalar_t__ time_t;
struct stat {
  scalar_t__ st_ctime;
  scalar_t__ st_mtime;
  scalar_t__ st_atime;
};

/* Variables and functions */
time_t get_create_time(struct stat *filestat) {
  time_t ret, ret1;
  ret = (((filestat->st_ctime) < (filestat->st_mtime)) ? (filestat->st_ctime)
                                                       : (filestat->st_mtime));
  ret1 = (((ret) < (filestat->st_atime)) ? (ret) : (filestat->st_atime));
  if (ret1 != (time_t)0)
    return ret1;
  return ret;
}


x86 assembly (clang, -O0):
<get_create_time>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    0x8(%rcx),%rax
jge    112d <get_create_time+0x2d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
jmp    1139 <get_create_time+0x39>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmp    0x10(%rcx),%rax
jge    1160 <get_create_time+0x60>
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    116c <get_create_time+0x6c>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     118c <get_create_time+0x8c>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1194 <get_create_time+0x94>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_create_time>:
mov    (%rdi),%rax
mov    0x8(%rdi),%rcx
cmp    %rcx,%rax
cmovl  %rax,%rcx
mov    0x10(%rdi),%rax
cmp    %rax,%rcx
cmovl  %rcx,%rax
test   %rax,%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
%struct.stat = type { i64, i64, i64 }
define i64 @get_create_time(%struct.stat* %0) {
%2 = alloca i64
%3 = alloca %struct.stat*
%4 = alloca i64
%5 = alloca i64
store %struct.stat* %0, %struct.stat** %3
%6 = load %struct.stat*, %struct.stat** %3
%7 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%8 = load i64, i64* %7
%9 = load %struct.stat*, %struct.stat** %3
%10 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 1
%11 = load i64, i64* %10
%12 = icmp slt i64 %8, %11
br i1 %12, label %13, label %17
13: ; preds = %1
%14 = load %struct.stat*, %struct.stat** %3
%15 = getelementptr inbounds %struct.stat, %struct.stat* %14, i32 0, i32 0
%16 = load i64, i64* %15
br label %21
17: ; preds = %1
%18 = load %struct.stat*, %struct.stat** %3
%19 = getelementptr inbounds %struct.stat, %struct.stat* %18, i32 0, i32 1
%20 = load i64, i64* %19
br label %21
21: ; preds = %17, %13
%22 = phi i64 [ %16, %13 ], [ %20, %17 ]
store i64 %22, i64* %4
%23 = load i64, i64* %4
%24 = load %struct.stat*, %struct.stat** %3
%25 = getelementptr inbounds %struct.stat, %struct.stat* %24, i32 0, i32 2
%26 = load i64, i64* %25
%27 = icmp slt i64 %23, %26
br i1 %27, label %28, label %30
28: ; preds = %21
%29 = load i64, i64* %4
br label %34
30: ; preds = %21
%31 = load %struct.stat*, %struct.stat** %3
%32 = getelementptr inbounds %struct.stat, %struct.stat* %31, i32 0, i32 2
%33 = load i64, i64* %32
br label %34
34: ; preds = %30, %28
%35 = phi i64 [ %29, %28 ], [ %33, %30 ]
store i64 %35, i64* %5
%36 = load i64, i64* %5
%37 = icmp ne i64 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %34
%39 = load i64, i64* %5
store i64 %39, i64* %2
br label %42
40: ; preds = %34
%41 = load i64, i64* %4
store i64 %41, i64* %2
br label %42
42: ; preds = %40, %38
%43 = load i64, i64* %2
ret i64 %43
}

LLVM IR (-O2):
%struct.stat = type { i64, i64, i64 }
define i64 @get_create_time(%struct.stat* nocapture %0) {
%2 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 1
%5 = load i64, i64* %4
%6 = icmp slt i64 %3, %5
%7 = select i1 %6, i64 %3, i64 %5
%8 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 2
%9 = load i64, i64* %8
%10 = icmp slt i64 %7, %9
%11 = select i1 %10, i64 %7, i64 %9
%12 = icmp eq i64 %11, 0
%13 = select i1 %12, i64 %7, i64 %11
ret i64 %13
}