#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 */
float berechne_mehrwertsteuer(float, float);
float berechne_nettopreis(float, float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main(void) {
  printf("\nProgramm zum Berechnen des Mehrwertsteueranteils"
         " von Preisen.\n");
  printf("\nEingabe Bruttopreis in Euro:        ");
  float bruttopreis;
  scanf("%f", &bruttopreis);
  printf("Eingabe Mehrwertsteuersatz in %%:    ");
  float mwst_satz;
  scanf("%f", &mwst_satz);
  float nettopreis;
  nettopreis = berechne_nettopreis(bruttopreis, mwst_satz);
  float mwst_anteil;
  mwst_anteil = berechne_mehrwertsteuer(nettopreis, mwst_satz);
  if (nettopreis >= 0 && mwst_anteil >= 0) {
    printf("\nBruttopreis:            %10.2f Euro", bruttopreis);
    printf("\nNettopreis:             %10.2f Euro", nettopreis);
    printf("\nMehrwertsteueranteil:   %10.2f Euro\n\n", mwst_anteil);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xee7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1060 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
call   1050 <berechne_nettopreis@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
call   1040 <berechne_mehrwertsteuer@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1228 <main+0xe8>
movss  -0x14(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1228 <main+0xe8>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeaa(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xf64(%rip),%rdi
call   1030 <puts@plt>
lea    0xe98(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb0(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
lea    0xe9f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
movss  0x8(%rsp),%xmm0
movss  0x4(%rsp),%xmm1
call   1060 <berechne_nettopreis@plt>
movss  %xmm0,(%rsp)
movss  0x4(%rsp),%xmm1
call   1050 <berechne_mehrwertsteuer@plt>
movaps %xmm0,%xmm1
xorps  %xmm0,%xmm0
movss  (%rsp),%xmm2
ucomiss %xmm0,%xmm2
jb     1221 <main+0xd1>
ucomiss %xmm0,%xmm1
jb     1221 <main+0xd1>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe6a(%rip),%rdi
mov    $0x1,%al
movss  %xmm1,0xc(%rsp)
call   1040 <printf@plt>
movss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe72(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe7f(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [64 x i8] c"\0AProgramm zum Berechnen des Mehrwertsteueranteils von Preisen.\0A\00"
@.str.1 = [38 x i8] c"\0AEingabe Bruttopreis in Euro: \00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [38 x i8] c"Eingabe Mehrwertsteuersatz in %%: \00"
@.str.4 = [37 x i8] c"\0ABruttopreis: %10.2f Euro\00"
@.str.5 = [37 x i8] c"\0ANettopreis: %10.2f Euro\00"
@.str.6 = [39 x i8] c"\0AMehrwertsteueranteil: %10.2f Euro\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%11 = load float, float* %2
%12 = load float, float* %3
%13 = call float @berechne_nettopreis(float %11, float %12)
store float %13, float* %4
%14 = load float, float* %4
%15 = load float, float* %3
%16 = call float @berechne_mehrwertsteuer(float %14, float %15)
store float %16, float* %5
%17 = load float, float* %4
%18 = fcmp oge float %17, 0.000000e+00
br i1 %18, label %19, label %32
19: ; preds = %0
%20 = load float, float* %5
%21 = fcmp oge float %20, 0.000000e+00
br i1 %21, label %22, label %32
22: ; preds = %19
%23 = load float, float* %2
%24 = fpext float %23 to double
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), double %24)
%26 = load float, float* %4
%27 = fpext float %26 to double
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), double %27)
%29 = load float, float* %5
%30 = fpext float %29 to double
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0), double %30)
br label %32
32: ; preds = %22, %19, %0
%33 = load i32, i32* %1
ret i32 %33
}

LLVM IR (-O2):
@.str.1 = [38 x i8] c"\0AEingabe Bruttopreis in Euro: \00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [38 x i8] c"Eingabe Mehrwertsteuersatz in %%: \00"
@.str.4 = [37 x i8] c"\0ABruttopreis: %10.2f Euro\00"
@.str.5 = [37 x i8] c"\0ANettopreis: %10.2f Euro\00"
@.str.6 = [39 x i8] c"\0AMehrwertsteueranteil: %10.2f Euro\0A\0A\00"
@str = [63 x i8] c"\0AProgramm zum Berechnen des Mehrwertsteueranteils von Preisen.\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%5 = bitcast float* %1 to i8*
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %1)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%8 = bitcast float* %2 to i8*
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%10 = load float, float* %1
%11 = load float, float* %2
%12 = call float @berechne_nettopreis(float %10, float %11)
%13 = load float, float* %2
%14 = call float @berechne_mehrwertsteuer(float %12, float %13)
%15 = fcmp oge float %12, 0.000000e+00
%16 = fcmp oge float %14, 0.000000e+00
%17 = select i1 %15, i1 %16, i1 false
br i1 %17, label %18, label %26
18: ; preds = %0
%19 = load float, float* %1
%20 = fpext float %19 to double
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), double %20)
%22 = fpext float %12 to double
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), double %22)
%24 = fpext float %14 to double
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0), double %24)
br label %26
26: ; preds = %18, %0
ret i32 0
}