#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 time_t;
struct tms {
  int dummy;
};
typedef int /*<<< orphan*/ clock_t;

/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int time(int /*<<< orphan*/ *);
int /*<<< orphan*/ times(struct tms *);
void dumptime(time_t *the_time, clock_t *the_jiffies) {
  struct tms cur_time;
  if ((*the_time = time(NULL)) == -1)
    perror("time");
  if ((*the_jiffies = times(&cur_time)) == (clock_t)-1)
    perror("times");
}


x86 assembly (clang, -O0):
<dumptime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
mov    -0x8(%rbp),%rcx
mov    %eax,(%rcx)
cmp    $0xffffffff,%eax
jne    1164 <dumptime+0x34>
lea    0xea1(%rip),%rdi
call   1050 <perror@plt>
lea    -0x18(%rbp),%rdi
call   1040 <times@plt>
mov    -0x10(%rbp),%rcx
mov    %eax,(%rcx)
cmp    $0xffffffff,%eax
jne    1188 <dumptime+0x58>
lea    0xe82(%rip),%rdi
call   1050 <perror@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumptime>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
call   1030 <time@plt>
mov    %eax,(%rbx)
cmp    $0xffffffff,%eax
je     1160 <dumptime+0x30>
mov    %rsp,%rdi
call   1040 <times@plt>
mov    %eax,(%r14)
cmp    $0xffffffff,%eax
je     116e <dumptime+0x3e>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe99(%rip),%rdi
call   1050 <perror@plt>
jmp    1148 <dumptime+0x18>
lea    0xe90(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <perror@plt>

LLVM IR (-O0):
%struct.tms = type { i32 }
@.str = [5 x i8] c"time\00"
@.str.1 = [6 x i8] c"times\00"
define void @dumptime(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca %struct.tms
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = call i32 @time(i32* null)
%7 = load i32*, i32** %3
store i32 %6, i32* %7
%8 = icmp eq i32 %6, -1
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
%12 = call i32 @times(%struct.tms* %5)
%13 = load i32*, i32** %4
store i32 %12, i32* %13
%14 = icmp eq i32 %12, -1
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %17
17: ; preds = %15, %11
ret void
}

LLVM IR (-O2):
%struct.tms = type { i32 }
@.str = [5 x i8] c"time\00"
@.str.1 = [6 x i8] c"times\00"
define void @dumptime(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
%3 = alloca %struct.tms
%4 = bitcast %struct.tms* %3 to i8*
%5 = tail call i32 @time(i32* null)
store i32 %5, i32* %0
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
%10 = call i32 @times(%struct.tms* %3)
store i32 %10, i32* %1
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %9
ret void
}