#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;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
scalar_t__ fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ *stdin;
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strtol(char *, int /*<<< orphan*/ *, int);
void interperet(char *fn) {
  FILE *fh;
  char buf[32];
  char *p;
  time_t clock;
  if (fn == NULL || strcmp(fn, "-") == 0)
    fh = stdin;
  else
    fh = fopen(fn, "r");
  if (fh != NULL) {
    if (fread(buf, 1, 32, fh) > 0) {
      clock = strtol(buf, NULL, 10);
      printf("clock set to %s", ctime(&clock));
    }
    fclose(fh);
  }
  return;
}


x86 assembly (clang, -O0):
<interperet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     11a1 <interperet+0x31>
mov    -0x8(%rbp),%rdi
lea    0xe6e(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    11b4 <interperet+0x44>
mov    0x2e40(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
jmp    11c8 <interperet+0x58>
mov    -0x8(%rbp),%rdi
lea    0xe43(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     122a <interperet+0xba>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
mov    $0x20,%edx
call   1030 <fread@plt>
cmp    $0x0,%rax
jle    1221 <interperet+0xb1>
lea    -0x30(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1080 <strtol@plt>
mov    %eax,-0x3c(%rbp)
lea    -0x3c(%rbp),%rdi
call   1050 <ctime@plt>
mov    %rax,%rsi
lea    0xde8(%rip),%rdi
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interperet>:
push   %rbx
sub    $0x30,%rsp
test   %rdi,%rdi
je     11a7 <interperet+0x37>
mov    %rdi,%rbx
lea    0xe7c(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     11a7 <interperet+0x37>
lea    0xe6d(%rip),%rsi
mov    %rbx,%rdi
call   1090 <fopen@plt>
mov    %rax,%rbx
test   %rbx,%rbx
jne    11b6 <interperet+0x46>
jmp    1208 <interperet+0x98>
mov    0x2e3a(%rip),%rax
mov    (%rax),%rbx
test   %rbx,%rbx
je     1208 <interperet+0x98>
lea    0x10(%rsp),%rdi
mov    $0x1,%esi
mov    $0x20,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
test   %rax,%rax
jle    1200 <interperet+0x90>
lea    0x10(%rsp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1080 <strtol@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1050 <ctime@plt>
lea    0xe0c(%rip),%rdi
mov    %rax,%rsi
call   1060 <printf@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"-\00"
@stdin = global i32* null
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [16 x i8] c"clock set to %s\00"
define void @interperet(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca [32 x i8]
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %2
%7 = load i8*, i8** %2
%8 = icmp eq i8* %7, null
br i1 %8, label %13, label %9
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %9, %1
%14 = load i32*, i32** @stdin
store i32* %14, i32** %3
br label %18
15: ; preds = %9
%16 = load i8*, i8** %2
%17 = call i32* @fopen(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %17, i32** %3
br label %18
18: ; preds = %15, %13
%19 = load i32*, i32** %3
%20 = icmp ne i32* %19, null
br i1 %20, label %21, label %34
21: ; preds = %18
%22 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%23 = load i32*, i32** %3
%24 = call i64 @fread(i8* %22, i32 1, i32 32, i32* %23)
%25 = icmp sgt i64 %24, 0
br i1 %25, label %26, label %31
26: ; preds = %21
%27 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%28 = call i32 @strtol(i8* %27, i32* null, i32 10)
store i32 %28, i32* %6
%29 = call i8* @ctime(i32* %6)
%30 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* %29)
br label %31
31: ; preds = %26, %21
%32 = load i32*, i32** %3
%33 = call i32 @fclose(i32* %32)
br label %34
34: ; preds = %31, %18
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"-\00"
@stdin = global i32* null
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [16 x i8] c"clock set to %s\00"
define void @interperet(i8* %0) {
%2 = alloca [32 x i8]
%3 = alloca i32
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%5 = bitcast i32* %3 to i8*
%6 = icmp eq i8* %0, null
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7, %1
%11 = load i32*, i32** @stdin
br label %14
12: ; preds = %7
%13 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
%15 = phi i32* [ %11, %10 ], [ %13, %12 ]
%16 = icmp eq i32* %15, null
br i1 %16, label %26, label %17
17: ; preds = %14
%18 = call i64 @fread(i8* %4, i32 1, i32 32, i32* %15)
%19 = icmp sgt i64 %18, 0
br i1 %19, label %20, label %24
20: ; preds = %17
%21 = call i32 @strtol(i8* nocapture %4, i32* null, i32 10)
store i32 %21, i32* %3
%22 = call i8* @ctime(i32* %3)
%23 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* %22)
br label %24
24: ; preds = %20, %17
%25 = call i32 @fclose(i32* %15)
br label %26
26: ; preds = %24, %14
ret void
}