#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 */
int /*<<< orphan*/ fpom(int, double, double *, double *);
int round(double);
void pom(int year, double utcoffset, int *fms, int *nms) {
  double ffms[18];
  double fnms[18];
  int i, j;
  fpom(year, utcoffset, ffms, fnms);
  j = 0;
  for (i = 0; ffms[i] != 0; i++)
    fms[j++] = round(ffms[i]);
  fms[i] = -1;
  for (i = 0; fnms[i] != 0; i++)
    nms[i] = round(fnms[i]);
  nms[i] = -1;
}


x86 assembly (clang, -O0):
<pom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
lea    -0xb0(%rbp),%rsi
lea    -0x140(%rbp),%rdx
call   1030 <fpom@plt>
movl   $0x0,-0x148(%rbp)
movl   $0x0,-0x144(%rbp)
movslq -0x144(%rbp),%rax
movsd  -0xb0(%rbp,%rax,8),%xmm0
ff ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1192 <pom+0x72>
jp     1192 <pom+0x72>
jmp    11d8 <pom+0xb8>
movslq -0x144(%rbp),%rax
movsd  -0xb0(%rbp,%rax,8),%xmm0
ff ff
call   1040 <round@plt>
mov    %eax,%edx
mov    -0x18(%rbp),%rax
mov    -0x148(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x148(%rbp)
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x144(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x144(%rbp)
jmp    116a <pom+0x4a>
mov    -0x18(%rbp),%rax
movslq -0x144(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
movl   $0x0,-0x144(%rbp)
movslq -0x144(%rbp),%rax
movsd  -0x140(%rbp,%rax,8),%xmm0
ff ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    121c <pom+0xfc>
jp     121c <pom+0xfc>
jmp    1255 <pom+0x135>
movslq -0x144(%rbp),%rax
movsd  -0x140(%rbp,%rax,8),%xmm0
ff ff
call   1040 <round@plt>
mov    %eax,%edx
mov    -0x20(%rbp),%rax
movslq -0x144(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x144(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x144(%rbp)
jmp    11f4 <pom+0xd4>
mov    -0x20(%rbp),%rax
movslq -0x144(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pom>:
push   %r15
push   %r14
push   %rbx
sub    $0x120,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
lea    0x90(%rsp),%rsi
mov    %rsp,%rdx
call   1030 <fpom@plt>
movsd  0x90(%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1157 <pom+0x37>
jnp    1189 <pom+0x69>
xor    %ecx,%ecx
nopl   0x0(%rax)
mov    %rcx,%rbx
call   1040 <round@plt>
xorpd  %xmm1,%xmm1
lea    0x1(%rbx),%rcx
mov    %eax,(%r15,%rbx,4)
movsd  0x98(%rsp,%rbx,8),%xmm0
ucomisd %xmm1,%xmm0
jne    1160 <pom+0x40>
jp     1160 <pom+0x40>
mov    %ecx,%eax
jmp    118b <pom+0x6b>
xor    %eax,%eax
movl   $0xffffffff,(%r15,%rax,4)
ff
movsd  (%rsp),%xmm0
ucomisd %xmm1,%xmm0
jne    11a0 <pom+0x80>
jnp    11d3 <pom+0xb3>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
call   1040 <round@plt>
mov    %eax,(%r14,%rbx,4)
movsd  0x8(%rsp,%rbx,8),%xmm0
add    $0x1,%rbx
ucomisd 0xe35(%rip),%xmm0
jne    11b0 <pom+0x90>
jp     11b0 <pom+0x90>
mov    %ebx,%eax
jmp    11d5 <pom+0xb5>
xor    %eax,%eax
movl   $0xffffffff,(%r14,%rax,4)
ff
add    $0x120,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @pom(i32 %0, double %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca [18 x double]
%10 = alloca [18 x double]
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %5
store double %1, double* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%13 = load i32, i32* %5
%14 = load double, double* %6
%15 = getelementptr inbounds [18 x double], [18 x double]* %9, i64 0, i64 0
%16 = getelementptr inbounds [18 x double], [18 x double]* %10, i64 0, i64 0
%17 = call i32 @fpom(i32 %13, double %14, double* %15, double* %16)
store i32 0, i32* %12
store i32 0, i32* %11
br label %18
18: ; preds = %35, %4
%19 = load i32, i32* %11
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [18 x double], [18 x double]* %9, i64 0, i64 %20
%22 = load double, double* %21
%23 = fcmp une double %22, 0.000000e+00
br i1 %23, label %24, label %38
24: ; preds = %18
%25 = load i32, i32* %11
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [18 x double], [18 x double]* %9, i64 0, i64 %26
%28 = load double, double* %27
%29 = call i32 @round(double %28)
%30 = load i32*, i32** %7
%31 = load i32, i32* %12
%32 = add nsw i32 %31, 1
store i32 %32, i32* %12
%33 = sext i32 %31 to i64
%34 = getelementptr inbounds i32, i32* %30, i64 %33
store i32 %29, i32* %34
br label %35
35: ; preds = %24
%36 = load i32, i32* %11
%37 = add nsw i32 %36, 1
store i32 %37, i32* %11
br label %18
38: ; preds = %18
%39 = load i32*, i32** %7
%40 = load i32, i32* %11
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i32, i32* %39, i64 %41
store i32 -1, i32* %42
store i32 0, i32* %11
br label %43
43: ; preds = %59, %38
%44 = load i32, i32* %11
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [18 x double], [18 x double]* %10, i64 0, i64 %45
%47 = load double, double* %46
%48 = fcmp une double %47, 0.000000e+00
br i1 %48, label %49, label %62
49: ; preds = %43
%50 = load i32, i32* %11
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [18 x double], [18 x double]* %10, i64 0, i64 %51
%53 = load double, double* %52
%54 = call i32 @round(double %53)
%55 = load i32*, i32** %8
%56 = load i32, i32* %11
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i32, i32* %55, i64 %57
store i32 %54, i32* %58
br label %59
59: ; preds = %49
%60 = load i32, i32* %11
%61 = add nsw i32 %60, 1
store i32 %61, i32* %11
br label %43
62: ; preds = %43
%63 = load i32*, i32** %8
%64 = load i32, i32* %11
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds i32, i32* %63, i64 %65
store i32 -1, i32* %66
ret void
}

LLVM IR (-O2):
define void @pom(i32 %0, double %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = alloca [18 x double]
%6 = alloca [18 x double]
%7 = bitcast [18 x double]* %5 to i8*
%8 = bitcast [18 x double]* %6 to i8*
%9 = getelementptr inbounds [18 x double], [18 x double]* %5, i64 0, i64 0
%10 = getelementptr inbounds [18 x double], [18 x double]* %6, i64 0, i64 0
%11 = call i32 @fpom(i32 %0, double %1, double* %9, double* %10)
%12 = load double, double* %9
%13 = fcmp une double %12, 0.000000e+00
br i1 %13, label %14, label %25
14: ; preds = %4, %14
%15 = phi i64 [ %18, %14 ], [ 0, %4 ]
%16 = phi double [ %21, %14 ], [ %12, %4 ]
%17 = call i32 @round(double %16)
%18 = add nuw i64 %15, 1
%19 = getelementptr inbounds i32, i32* %2, i64 %15
store i32 %17, i32* %19
%20 = getelementptr inbounds [18 x double], [18 x double]* %5, i64 0, i64 %18
%21 = load double, double* %20
%22 = fcmp une double %21, 0.000000e+00
br i1 %22, label %14, label %23
23: ; preds = %14
%24 = and i64 %18, 4294967295
br label %25
25: ; preds = %23, %4
%26 = phi i64 [ 0, %4 ], [ %24, %23 ]
%27 = getelementptr inbounds i32, i32* %2, i64 %26
store i32 -1, i32* %27
%28 = load double, double* %10
%29 = fcmp une double %28, 0.000000e+00
br i1 %29, label %30, label %41
30: ; preds = %25, %30
%31 = phi i64 [ %35, %30 ], [ 0, %25 ]
%32 = phi double [ %37, %30 ], [ %28, %25 ]
%33 = call i32 @round(double %32)
%34 = getelementptr inbounds i32, i32* %3, i64 %31
store i32 %33, i32* %34
%35 = add nuw i64 %31, 1
%36 = getelementptr inbounds [18 x double], [18 x double]* %6, i64 0, i64 %35
%37 = load double, double* %36
%38 = fcmp une double %37, 0.000000e+00
br i1 %38, label %30, label %39
39: ; preds = %30
%40 = and i64 %35, 4294967295
br label %41
41: ; preds = %39, %25
%42 = phi i64 [ 0, %25 ], [ %40, %39 ]
%43 = getelementptr inbounds i32, i32* %3, i64 %42
store i32 -1, i32* %43
ret void
}