#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 pow(int, int);
double berechne_annuitaet_wiki(double kredit, double zinssatz, int laufzeit) {
  double annuitaet = kredit * ((zinssatz * pow((1 + zinssatz), laufzeit)) /
                               (pow((1 + zinssatz), laufzeit) - 1));
  return annuitaet;
}


x86 assembly (clang, -O0):
<berechne_annuitaet_wiki>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xebf(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%edi
mov    -0x14(%rbp),%esi
call   1030 <pow@plt>
movsd  -0x38(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe94(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%edi
mov    -0x14(%rbp),%esi
call   1030 <pow@plt>
movsd  -0x30(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
sub    $0x1,%eax
cvtsi2sd %eax,%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<berechne_annuitaet_wiki>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebx
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
movsd  0xed4(%rip),%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ebp
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <pow@plt>
add    $0xffffffff,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  0x10(%rsp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @berechne_annuitaet_wiki(double %0, double %1, i32 %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i32
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store i32 %2, i32* %6
%8 = load double, double* %4
%9 = load double, double* %5
%10 = load double, double* %5
%11 = fadd double 1.000000e+00, %10
%12 = fptosi double %11 to i32
%13 = load i32, i32* %6
%14 = call i32 @pow(i32 %12, i32 %13)
%15 = sitofp i32 %14 to double
%16 = fmul double %9, %15
%17 = load double, double* %5
%18 = fadd double 1.000000e+00, %17
%19 = fptosi double %18 to i32
%20 = load i32, i32* %6
%21 = call i32 @pow(i32 %19, i32 %20)
%22 = sub nsw i32 %21, 1
%23 = sitofp i32 %22 to double
%24 = fdiv double %16, %23
%25 = fmul double %8, %24
store double %25, double* %7
%26 = load double, double* %7
ret double %26
}

LLVM IR (-O2):
define double @berechne_annuitaet_wiki(double %0, double %1, i32 %2) {
%4 = fadd double %1, 1.000000e+00
%5 = fptosi double %4 to i32
%6 = tail call i32 @pow(i32 %5, i32 %2)
%7 = sitofp i32 %6 to double
%8 = fmul double %7, %1
%9 = tail call i32 @pow(i32 %5, i32 %2)
%10 = add nsw i32 %9, -1
%11 = sitofp i32 %10 to double
%12 = fdiv double %8, %11
%13 = fmul double %12, %0
ret double %13
}