#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 *, ...);
int strcmp(char *, char *);
int main() {
  double values[50];
  char next;
  char no = 'n';
  for (int i = 0; i < 50; ++i) {
    printf("Please enter a value: ");
    scanf("%lf", &(values[i]));
    printf("Möchten Sie noch eine zahl eingeben?(yn): ");
    scanf("%s", &next);
    if (strcmp(&next, &no) == -1) {
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x6e,-0x1a2(%rbp)
movl   $0x0,-0x1a8(%rbp)
cmpl   $0x32,-0x1a8(%rbp)
jge    11ea <main+0xba>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
movslq -0x1a8(%rbp),%rax
lea    -0x1a0(%rbp),%rsi
shl    $0x3,%rax
add    %rax,%rsi
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
lea    0xea5(%rip),%rdi
lea    -0x1a1(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    -0x1a1(%rbp),%rdi
lea    -0x1a2(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0xffffffff,%eax
jne    11d1 <main+0xa1>
jmp    11ea <main+0xba>
jmp    11d6 <main+0xa6>
mov    -0x1a8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a8(%rbp)
jmp    1153 <main+0x23>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1a8,%rsp
movb   $0x6e,0xe(%rsp)
lea    0xeca(%rip),%r15
lea    0xec7(%rip),%r12
lea    0xeec(%rip),%r13
lea    0xf(%rsp),%rbx
lea    0xe(%rsp),%rbp
xor    %r14d,%r14d
nopl   0x0(%rax,%rax,1)
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
lea    (%rsp,%r14,1),%rsi
add    $0x10,%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r12,%rdi
call   1030 <printf@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1040 <strcmp@plt>
cmp    $0xffffffff,%eax
je     11c3 <main+0x93>
lea    0x8(%r14),%rax
cmp    $0x188,%r14
mov    %rax,%r14
jne    1170 <main+0x40>
xor    %eax,%eax
add    $0x1a8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Please enter a value: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [44 x i8] c"M\C3\B6chten Sie noch eine zahl eingeben?(yn): \00"
@.str.3 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x double]
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i32 0, i32* %1
store i8 110, i8* %4
store i32 0, i32* %5
br label %6
6: ; preds = %21, %0
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 50
br i1 %8, label %9, label %24
9: ; preds = %6
%10 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [50 x double], [50 x double]* %2, i64 0, i64 %12
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %3)
%17 = call i32 @strcmp(i8* %3, i8* %4)
%18 = icmp eq i32 %17, -1
br i1 %18, label %19, label %20
19: ; preds = %9
br label %24
20: ; preds = %9
br label %21
21: ; preds = %20
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %6
24: ; preds = %19, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Please enter a value: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [44 x i8] c"M\C3\B6chten Sie noch eine zahl eingeben?(yn): \00"
@.str.3 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [50 x double]
%2 = alloca i8
%3 = alloca i8
%4 = bitcast [50 x double]* %1 to i8*
store i8 110, i8* %3
br label %5
5: ; preds = %5, %0
%6 = phi i64 [ 0, %0 ], [ %14, %5 ]
%7 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [50 x double], [50 x double]* %1, i64 0, i64 %6
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %8)
%10 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %2)
%12 = call i32 @strcmp(i8* %2, i8* %3)
%13 = icmp eq i32 %12, -1
%14 = add nuw nsw i64 %6, 1
%15 = icmp eq i64 %14, 50
%16 = select i1 %13, i1 true, i1 %15
br i1 %16, label %17, label %5
17: ; preds = %5
ret i32 0
}