#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*/ printf(char *);
float berechne_nettopreis(float bruttopreis, float mwst) {
  float nettopreis;
  if ((bruttopreis >= 0) && (0 <= mwst) && (mwst <= 100))
    nettopreis = bruttopreis / (1 + mwst / 100);
  else {
    printf("Nettopreis kann nicht berechnet werden.\n");
    nettopreis = -1;
  }
  return nettopreis;
}


x86 assembly (clang, -O0):
<berechne_nettopreis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1186 <berechne_nettopreis+0x76>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1186 <berechne_nettopreis+0x76>
movss  0xeb4(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     1186 <berechne_nettopreis+0x76>
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
movss  0xe98(%rip),%xmm1
divss  %xmm1,%xmm2
movss  0xe94(%rip),%xmm1
addss  %xmm2,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    119f <berechne_nettopreis+0x8f>
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
movss  0xe6a(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<berechne_nettopreis>:
push   %rax
movss  0xee7(%rip),%xmm2
ucomiss %xmm1,%xmm2
jb     1141 <berechne_nettopreis+0x31>
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm0
jb     1141 <berechne_nettopreis+0x31>
ucomiss %xmm2,%xmm1
jb     1141 <berechne_nettopreis+0x31>
divss  0xecd(%rip),%xmm1
addss  0xecd(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rax
ret
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
movss  0xeaf(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [41 x i8] c"Nettopreis kann nicht berechnet werden.\0A\00"
define float @berechne_nettopreis(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = fcmp oge float %6, 0.000000e+00
br i1 %7, label %8, label %20
8: ; preds = %2
%9 = load float, float* %4
%10 = fcmp ole float 0.000000e+00, %9
br i1 %10, label %11, label %20
11: ; preds = %8
%12 = load float, float* %4
%13 = fcmp ole float %12, 1.000000e+02
br i1 %13, label %14, label %20
14: ; preds = %11
%15 = load float, float* %3
%16 = load float, float* %4
%17 = fdiv float %16, 1.000000e+02
%18 = fadd float 1.000000e+00, %17
%19 = fdiv float %15, %18
store float %19, float* %5
br label %22
20: ; preds = %11, %8, %2
%21 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
store float -1.000000e+00, float* %5
br label %22
22: ; preds = %20, %14
%23 = load float, float* %5
ret float %23
}

LLVM IR (-O2):
@str = [40 x i8] c"Nettopreis kann nicht berechnet werden.\00"
define float @berechne_nettopreis(float %0, float %1) {
%3 = fcmp oge float %0, 0.000000e+00
%4 = fcmp oge float %1, 0.000000e+00
%5 = and i1 %3, %4
%6 = fcmp ole float %1, 1.000000e+02
%7 = and i1 %6, %5
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = fdiv float %1, 1.000000e+02
%10 = fadd float %9, 1.000000e+00
%11 = fdiv float %0, %10
br label %14
12: ; preds = %2
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
br label %14
14: ; preds = %12, %8
%15 = phi float [ %11, %8 ], [ -1.000000e+00, %12 ]
ret float %15
}