#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*/ printf(char *, ...);
int /*<<< orphan*/ smp_file_access_time(char const *);
int smp_file_set_access_time(char const *, int);
int smp_test_file_access_time(const char *file) {
  if (smp_file_set_access_time(file, 123) == (-1)) {
    printf("set modify err\n");
    return (-1);
  }
  printf("%ld\n", smp_file_access_time(file));
  return (0);
}


x86 assembly (clang, -O0):
<smp_test_file_access_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x7b,%esi
call   1040 <smp_file_set_access_time@plt>
cmp    $0xffffffff,%eax
jne    116d <smp_test_file_access_time+0x3d>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    118d <smp_test_file_access_time+0x5d>
mov    -0x10(%rbp),%rdi
call   1050 <smp_file_access_time@plt>
mov    %eax,%esi
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smp_test_file_access_time>:
push   %rbx
mov    %rdi,%rbx
mov    $0x7b,%esi
call   1050 <smp_file_set_access_time@plt>
cmp    $0xffffffff,%eax
je     116f <smp_test_file_access_time+0x2f>
mov    %rbx,%rdi
call   1060 <smp_file_access_time@plt>
lea    0xe9e(%rip),%rdi
xor    %ebx,%ebx
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1180 <smp_test_file_access_time+0x40>
lea    0xe8f(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"set modify err\0A\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
define i32 @smp_test_file_access_time(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @smp_file_set_access_time(i8* %4, i32 123)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %13
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i32 @smp_file_access_time(i8* %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %11)
store i32 0, i32* %2
br label %13
13: ; preds = %9, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"%ld\0A\00"
@str = [15 x i8] c"set modify err\00"
define i32 @smp_test_file_access_time(i8* %0) {
%2 = tail call i32 @smp_file_set_access_time(i8* %0, i32 123)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
br label %9
6: ; preds = %1
%7 = tail call i32 @smp_file_access_time(i8* %0)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6, %4
%10 = phi i32 [ -1, %4 ], [ 0, %6 ]
ret i32 %10
}