#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 tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
char *malloc(int);
int /*<<< orphan*/ oldgaa_gl__fout_of_memory(char *, int);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *get_seconds() {
  time_t tt;
  struct tm *t;
  char *str;
  str = malloc(80 + 1);
  if (!str)
    oldgaa_gl__fout_of_memory(
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/ellert/globus-toolkit/refs/heads/"
        "globus_6_branch/gsi/callback/source/library/oldgaa/"
        "oldgaa_policy_evaluator.c",
        762);
  ;
  time(&tt);
  t = localtime(&tt);
  strftime(str, 80, "%S", t);
  return str;
}


x86 assembly (clang, -O0):
<get_seconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x51,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1182 <get_seconds+0x32>
lea    0xe88(%rip),%rdi
mov    $0x2fa,%esi
call   1040 <oldgaa_gl__fout_of_memory@plt>
lea    -0x4(%rbp),%rdi
call   1050 <time@plt>
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x50,%esi
lea    0xf1c(%rip),%rdx
call   1070 <strftime@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_seconds>:
push   %r14
push   %rbx
push   %rax
mov    $0x51,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1177 <get_seconds+0x27>
lea    0xe93(%rip),%rdi
mov    $0x2fa,%esi
call   1040 <oldgaa_gl__fout_of_memory@plt>
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1050 <time@plt>
mov    %r14,%rdi
call   1030 <localtime@plt>
lea    0xf35(%rip),%rdx
mov    %rbx,%rdi
mov    $0x50,%esi
mov    %rax,%rcx
call   1070 <strftime@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [200 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ellert/globus-toolkit/refs/heads/globus_6_branch/gsi/callback/source/library/oldgaa/oldgaa_policy_evaluator.c\00"
@.str.1 = [3 x i8] c"%S\00"
define i8* @get_seconds() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = alloca i8*
%4 = call i8* @malloc(i32 81)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = call i32 @oldgaa_gl__fout_of_memory(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0), i32 762)
br label %9
9: ; preds = %7, %0
%10 = call i32 @time(i32* %1)
%11 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %11, %struct.tm** %2
%12 = load i8*, i8** %3
%13 = load %struct.tm*, %struct.tm** %2
%14 = call i32 @strftime(i8* %12, i32 80, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %struct.tm* %13)
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [200 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ellert/globus-toolkit/refs/heads/globus_6_branch/gsi/callback/source/library/oldgaa/oldgaa_policy_evaluator.c\00"
@.str.1 = [3 x i8] c"%S\00"
define i8* @get_seconds() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call dereferenceable_or_null(81) i8* @malloc(i32 81)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @oldgaa_gl__fout_of_memory(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0), i32 762)
br label %7
7: ; preds = %5, %0
%8 = call i32 @time(i32* %1)
%9 = call %struct.tm* @localtime(i32* %1)
%10 = call i32 @strftime(i8* %3, i32 80, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %struct.tm* %9)
ret i8* %3
}