#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 */
double mystery(float, unsigned int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  float x;
  double result;
  unsigned n;
  while (1) {
    printf("Bitte x angeben: ");
    scanf("%e", &x);
    printf("Bitte n angeben: ");
    scanf("%u", &n);
    if (x == 0)
      return 0;
    result = mystery(x, n);
    printf("%G = %G * %u\n", result, x, n);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb3(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    119e <main+0x6e>
jp     119e <main+0x6e>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret
movss  -0x8(%rbp),%xmm0
mov    -0x14(%rbp),%edi
call   1050 <mystery@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    -0x14(%rbp),%esi
lea    0xe62(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
jmp    113f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xebe(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movss  (%rsp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    118e <main+0x5e>
jnp    1221 <main+0xf1>
lea    0xe6b(%rip),%r15
lea    0xe76(%rip),%r12
mov    %rsp,%r13
lea    0xe6f(%rip),%rbx
lea    0xe7a(%rip),%rbp
lea    0x4(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x4(%rsp),%edi
call   1050 <mystery@plt>
movss  (%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    0x4(%rsp),%esi
lea    0xe4d(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
xorps  %xmm1,%xmm1
movss  (%rsp),%xmm0
ucomiss %xmm1,%xmm0
jne    11c0 <main+0x90>
jp     11c0 <main+0x90>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Bitte x angeben: \00"
@.str.1 = [3 x i8] c"%e\00"
@.str.2 = [18 x i8] c"Bitte n angeben: \00"
@.str.3 = [3 x i8] c"%u\00"
@.str.4 = [14 x i8] c"%G = %G * %u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca double
%4 = alloca i32
store i32 0, i32* %1
br label %5
5: ; preds = %0, %13
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @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 ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %4)
%10 = load float, float* %2
%11 = fcmp oeq float %10, 0.000000e+00
br i1 %11, label %12, label %13
12: ; preds = %5
ret i32 0
13: ; preds = %5
%14 = load float, float* %2
%15 = load i32, i32* %4
%16 = call double @mystery(float %14, i32 %15)
store double %16, double* %3
%17 = load double, double* %3
%18 = load float, float* %2
%19 = fpext float %18 to double
%20 = load i32, i32* %4
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), double %17, double %19, i32 %20)
br label %5
}

LLVM IR (-O2):
@.str = [18 x i8] c"Bitte x angeben: \00"
@.str.1 = [3 x i8] c"%e\00"
@.str.2 = [18 x i8] c"Bitte n angeben: \00"
@.str.3 = [3 x i8] c"%u\00"
@.str.4 = [14 x i8] c"%G = %G * %u\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca i32
%3 = bitcast float* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %2)
%9 = load float, float* %1
%10 = fcmp oeq float %9, 0.000000e+00
br i1 %10, label %11, label %12
11: ; preds = %12, %0
ret i32 0
12: ; preds = %0, %12
%13 = phi float [ %24, %12 ], [ %9, %0 ]
%14 = load i32, i32* %2
%15 = call double @mystery(float %13, i32 %14)
%16 = load float, float* %1
%17 = fpext float %16 to double
%18 = load i32, i32* %2
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), double %15, double %17, i32 %18)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %2)
%24 = load float, float* %1
%25 = fcmp oeq float %24, 0.000000e+00
br i1 %25, label %11, label %12
}