#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 *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float z1, z2, z3;
  float tmp;
  printf("1. Zahl: ");
  scanf("%f", &z1);
  printf("2. Zahl: ");
  scanf("%f", &z2);
  printf("3. Zahl: ");
  scanf("%f", &z3);
  if (z1 < z2) {
    tmp = z1;
    z1 = z2;
    z2 = tmp;
  }
  if (z1 < z3) {
    tmp = z1;
    z1 = z3;
    z3 = tmp;
  }
  if (z2 < z3) {
    tmp = z2;
    z2 = z3;
    z3 = tmp;
  }
  printf("\n%f\n%f\n%f\n", z1, z2, z3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea8(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8a(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    11ba <main+0x9a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    11eb <main+0xcb>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    121c <main+0xfc>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x10(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xde3(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed0(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xebf(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xeae(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm2
movss  0x8(%rsp),%xmm1
ucomiss %xmm2,%xmm1
jbe    119f <main+0x7f>
movss  %xmm1,0xc(%rsp)
movss  %xmm2,0x8(%rsp)
movaps %xmm2,%xmm0
jmp    11a5 <main+0x85>
movaps %xmm1,%xmm0
movaps %xmm2,%xmm1
movss  0x4(%rsp),%xmm3
ucomiss %xmm1,%xmm3
jbe    11cc <main+0xac>
movss  %xmm3,0xc(%rsp)
movss  %xmm1,0x4(%rsp)
movaps %xmm3,%xmm2
ucomiss %xmm0,%xmm1
ja     11d7 <main+0xb7>
movaps %xmm1,%xmm3
movaps %xmm0,%xmm1
jmp    11e6 <main+0xc6>
movaps %xmm1,%xmm2
movaps %xmm3,%xmm1
ucomiss %xmm0,%xmm1
jbe    11c4 <main+0xa4>
movss  %xmm1,0x8(%rsp)
movss  %xmm0,0x4(%rsp)
movaps %xmm0,%xmm3
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
cvtss2sd %xmm1,%xmm1
xorps  %xmm2,%xmm2
cvtss2sd %xmm3,%xmm2
lea    0xe22(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"1. Zahl: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [10 x i8] c"2. Zahl: \00"
@.str.3 = [10 x i8] c"3. Zahl: \00"
@.str.4 = [11 x i8] c"\0A%f\0A%f\0A%f\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 ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%12 = load float, float* %2
%13 = load float, float* %3
%14 = fcmp olt float %12, %13
br i1 %14, label %15, label %19
15: ; preds = %0
%16 = load float, float* %2
store float %16, float* %5
%17 = load float, float* %3
store float %17, float* %2
%18 = load float, float* %5
store float %18, float* %3
br label %19
19: ; preds = %15, %0
%20 = load float, float* %2
%21 = load float, float* %4
%22 = fcmp olt float %20, %21
br i1 %22, label %23, label %27
23: ; preds = %19
%24 = load float, float* %2
store float %24, float* %5
%25 = load float, float* %4
store float %25, float* %2
%26 = load float, float* %5
store float %26, float* %4
br label %27
27: ; preds = %23, %19
%28 = load float, float* %3
%29 = load float, float* %4
%30 = fcmp olt float %28, %29
br i1 %30, label %31, label %35
31: ; preds = %27
%32 = load float, float* %3
store float %32, float* %5
%33 = load float, float* %4
store float %33, float* %3
%34 = load float, float* %5
store float %34, float* %4
br label %35
35: ; preds = %31, %27
%36 = load float, float* %2
%37 = fpext float %36 to double
%38 = load float, float* %3
%39 = fpext float %38 to double
%40 = load float, float* %4
%41 = fpext float %40 to double
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), double %37, double %39, double %41)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"1. Zahl: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [10 x i8] c"2. Zahl: \00"
@.str.3 = [10 x i8] c"3. Zahl: \00"
@.str.4 = [11 x i8] c"\0A%f\0A%f\0A%f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = bitcast float* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%13 = load float, float* %1
%14 = load float, float* %2
%15 = fcmp olt float %13, %14
br i1 %15, label %16, label %17
16: ; preds = %0
store float %14, float* %1
store float %13, float* %2
br label %17
17: ; preds = %16, %0
%18 = phi float [ %13, %16 ], [ %14, %0 ]
%19 = phi float [ %14, %16 ], [ %13, %0 ]
%20 = load float, float* %3
%21 = fcmp olt float %19, %20
br i1 %21, label %22, label %23
22: ; preds = %17
store float %20, float* %1
store float %19, float* %3
br label %23
23: ; preds = %22, %17
%24 = phi float [ %20, %22 ], [ %19, %17 ]
%25 = phi float [ %19, %22 ], [ %20, %17 ]
%26 = fcmp olt float %18, %25
br i1 %26, label %27, label %28
27: ; preds = %23
store float %25, float* %2
store float %18, float* %3
br label %28
28: ; preds = %27, %23
%29 = phi float [ %18, %27 ], [ %25, %23 ]
%30 = phi float [ %25, %27 ], [ %18, %23 ]
%31 = fpext float %24 to double
%32 = fpext float %30 to double
%33 = fpext float %29 to double
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), double %31, double %32, double %33)
ret i32 0
}