#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 pre1dec(char *, int, int);
double pre2dec(int, int, int, int, int);
double pre2dou(char *in) {
  int a, b, c, d, e = 0;
  a = pre1dec(in, 0, 4);
  b = pre1dec(in, 4, 4);
  c = pre1dec(in, 8, 4);
  d = pre1dec(in, 12, 3);
  e = pre1dec(in, 15, 1);
  double xf = 0;
  xf = pre2dec(a, b, c, d, e);
  return xf;
}


x86 assembly (clang, -O0):
<pre2dou>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <pre1dec@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4,%edx
mov    %edx,%esi
call   1040 <pre1dec@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x8,%esi
mov    $0x4,%edx
call   1040 <pre1dec@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xc,%esi
mov    $0x3,%edx
call   1040 <pre1dec@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xf,%esi
mov    $0x1,%edx
call   1040 <pre1dec@plt>
mov    %eax,-0x1c(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
call   1030 <pre2dec@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pre2dou>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <pre1dec@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x4,%edx
call   1040 <pre1dec@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x4,%edx
call   1040 <pre1dec@plt>
mov    %eax,%r12d
mov    %rbx,%rdi
mov    $0xc,%esi
mov    $0x3,%edx
call   1040 <pre1dec@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    $0xf,%esi
mov    $0x1,%edx
call   1040 <pre1dec@plt>
mov    %r14d,%edi
mov    %r15d,%esi
mov    %r12d,%edx
mov    %ebp,%ecx
mov    %eax,%r8d
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <pre2dec@plt>

LLVM IR (-O0):
define double @pre2dou(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
store i8* %0, i8** %2
store i32 0, i32* %7
%9 = load i8*, i8** %2
%10 = call i32 @pre1dec(i8* %9, i32 0, i32 4)
store i32 %10, i32* %3
%11 = load i8*, i8** %2
%12 = call i32 @pre1dec(i8* %11, i32 4, i32 4)
store i32 %12, i32* %4
%13 = load i8*, i8** %2
%14 = call i32 @pre1dec(i8* %13, i32 8, i32 4)
store i32 %14, i32* %5
%15 = load i8*, i8** %2
%16 = call i32 @pre1dec(i8* %15, i32 12, i32 3)
store i32 %16, i32* %6
%17 = load i8*, i8** %2
%18 = call i32 @pre1dec(i8* %17, i32 15, i32 1)
store i32 %18, i32* %7
store double 0.000000e+00, double* %8
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = load i32, i32* %6
%23 = load i32, i32* %7
%24 = call double @pre2dec(i32 %19, i32 %20, i32 %21, i32 %22, i32 %23)
store double %24, double* %8
%25 = load double, double* %8
ret double %25
}

LLVM IR (-O2):
define double @pre2dou(i8* %0) {
%2 = tail call i32 @pre1dec(i8* %0, i32 0, i32 4)
%3 = tail call i32 @pre1dec(i8* %0, i32 4, i32 4)
%4 = tail call i32 @pre1dec(i8* %0, i32 8, i32 4)
%5 = tail call i32 @pre1dec(i8* %0, i32 12, i32 3)
%6 = tail call i32 @pre1dec(i8* %0, i32 15, i32 1)
%7 = tail call double @pre2dec(i32 %2, i32 %3, i32 %4, i32 %5, i32 %6)
ret double %7
}