#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 int /*<<< orphan*/ time_t;
struct stat {
  int /*<<< orphan*/ st_mtime;
};

/* Variables and functions */
int /*<<< orphan*/ panic(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ perror(char const *);
scalar_t__ stat(char const *, struct stat *);
time_t modtime(const char *path) {
  struct stat st;
  if (stat(path, &st) != 0) {
    perror(path);
    panic(NULL,
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/bjarneh/organice/refs/heads/master/src/"
          "utilz/handy.c",
          71);
  }
  return st.st_mtime;
}


x86 assembly (clang, -O0):
<modtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
je     1171 <modtime+0x41>
mov    -0x8(%rbp),%rdi
call   1050 <perror@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xe99(%rip),%rsi
mov    $0x47,%edx
call   1030 <panic@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modtime>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
call   1040 <stat@plt>
test   %rax,%rax
jne    1151 <modtime+0x21>
mov    0x8(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret
mov    %rbx,%rdi
call   1050 <perror@plt>
lea    0xea0(%rip),%rsi
xor    %edi,%edi
mov    $0x47,%edx
call   1030 <panic@plt>
jmp    1147 <modtime+0x17>

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [143 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bjarneh/organice/refs/heads/master/src/utilz/handy.c\00"
define i32 @modtime(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @perror(i8* %8)
%10 = call i32 @panic(i32* null, i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, i64 0, i64 0), i32 71)
br label %11
11: ; preds = %7, %1
%12 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%13 = load i32, i32* %12
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [143 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bjarneh/organice/refs/heads/master/src/utilz/handy.c\00"
define i32 @modtime(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = call i32 @perror(i8* %0)
%8 = call i32 @panic(i32* null, i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, i64 0, i64 0), i32 71)
br label %9
9: ; preds = %6, %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%11 = load i32, i32* %10
ret i32 %11
}