#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 */
double atoi(char const *);
char *read_runtime();
int /*<<< orphan*/ sprintf(char *, char *, double);
scalar_t__ strcmp(char const *, char *);
const char *const read_runtime_h(void) {
  static char cache[20];
  const char *result;
  result = read_runtime();
  if (strcmp(result, "NULL") == 0)
    return "NULL";
  sprintf(cache, "%06.1f", atoi(result) / 3600.0);
  return cache;
}


x86 assembly (clang, -O0):
<read_runtime_h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <read_runtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeaa(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    117d <read_runtime_h+0x3d>
lea    0xe94(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11b0 <read_runtime_h+0x70>
mov    -0x10(%rbp),%rdi
call   1050 <atoi@plt>
movsd  0xe72(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0x2eb7(%rip),%rdi
lea    0xe6d(%rip),%rsi
call   1060 <sprintf@plt>
lea    0x2ea4(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_runtime_h>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <read_runtime@plt>
mov    %rax,%r14
lea    0xeb3(%rip),%rbx
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     118b <read_runtime_h+0x4b>
mov    %r14,%rdi
call   1050 <atoi@plt>
divsd  0xe8b(%rip),%xmm0
lea    0x2ed4(%rip),%rbx
lea    0xe8a(%rip),%rsi
mov    %rbx,%rdi
call   1060 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@read_runtime_h.cache = internal global [20 x i8] zeroinitializer
@.str = [5 x i8] c"NULL\00"
@.str.1 = [7 x i8] c"%06.1f\00"
define i8* @read_runtime_h() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* (...) @read_runtime()
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %1
br label %13
8: ; preds = %0
%9 = load i8*, i8** %2
%10 = call double @atoi(i8* %9)
%11 = fdiv double %10, 3.600000e+03
%12 = call i32 @sprintf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @read_runtime_h.cache, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %11)
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @read_runtime_h.cache, i64 0, i64 0), i8** %1
br label %13
13: ; preds = %8, %7
%14 = load i8*, i8** %1
ret i8* %14
}

LLVM IR (-O2):
@read_runtime_h.cache = internal global [20 x i8] zeroinitializer
@.str = [5 x i8] c"NULL\00"
@.str.1 = [7 x i8] c"%06.1f\00"
define i8* @read_runtime_h() {
%1 = tail call i8* (...) @read_runtime()
%2 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %0
%5 = tail call double @atoi(i8* %1)
%6 = fdiv double %5, 3.600000e+03
%7 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @read_runtime_h.cache, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %6)
br label %8
8: ; preds = %0, %4
%9 = phi i8* [ getelementptr inbounds ([20 x i8], [20 x i8]* @read_runtime_h.cache, i64 0, i64 0), %4 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %0 ]
ret i8* %9
}