#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 *, double);
int /*<<< orphan*/ scanf(char *, ...);
int strcmp(char *, char *);
int main() {
  float liczba;
  int iteracje, i;
  scanf("%f %d", &liczba, &iteracje);
  for (i = 0; i < iteracje; i++) {
    char typ[10];
    scanf("%s", typ);
    if (strcmp(typ, "int") == 1) {
      int temp = liczba;
      printf("%d\n", temp);
    }
    if (strcmp(typ, "long") == 1) {
      long long int temp = liczba;
      printf("%lld\n", temp);
    }
    if (strcmp(typ, "float") == 1) {
      printf("%f\n", liczba);
    }
    if (strcmp(typ, "double") == 1) {
      double temp = liczba;
      printf("%f\n", temp);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1050 <scanf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    125a <main+0x12a>
lea    -0x1a(%rbp),%rsi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    -0x1a(%rbp),%rdi
lea    0xe84(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x1,%eax
jne    11ac <main+0x7c>
cvttss2si -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
cvtsi2sdl -0x20(%rbp),%xmm0
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
lea    -0x1a(%rbp),%rdi
lea    0xe5a(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x1,%eax
jne    11e1 <main+0xb1>
cvttss2si -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
cvtsi2sdq -0x28(%rbp),%xmm0
lea    0xe3a(%rip),%rdi
call   1030 <printf@plt>
lea    -0x1a(%rbp),%rdi
lea    0xe30(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x1,%eax
jne    120f <main+0xdf>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe18(%rip),%rdi
call   1030 <printf@plt>
lea    -0x1a(%rbp),%rdi
lea    0xe0c(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x1,%eax
jne    1247 <main+0x117>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    0xde0(%rip),%rdi
call   1030 <printf@plt>
jmp    124c <main+0x11c>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    115c <main+0x2c>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xebb(%rip),%rdi
lea    0x4(%rsp),%rsi
lea    0x8(%rsp),%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0x0,0x8(%rsp)
jle    125a <main+0x12a>
lea    0xe(%rsp),%rbx
lea    0xe9c(%rip),%r15
lea    0xe9d(%rip),%r13
lea    0xea1(%rip),%r12
lea    0xea4(%rip),%rbp
xor    %r14d,%r14d
jmp    119f <main+0x6f>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r14d
cmp    0x8(%rsp),%r14d
jge    125a <main+0x12a>
lea    0xe60(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <strcmp@plt>
cmp    $0x1,%eax
jne    11da <main+0xaa>
movss  0x4(%rsp),%xmm0
cvttps2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
lea    0xe38(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1040 <strcmp@plt>
cmp    $0x1,%eax
jne    1205 <main+0xd5>
cvttss2si 0x4(%rsp),%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
lea    0xe16(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <strcmp@plt>
cmp    $0x1,%eax
jne    122b <main+0xfb>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdfc(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1040 <strcmp@plt>
cmp    $0x1,%eax
jne    1190 <main+0x60>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdd2(%rip),%rdi
call   1030 <printf@plt>
jmp    1190 <main+0x60>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%f %d\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"int\00"
@.str.3 = [4 x i8] c"%d\0A\00"
@.str.4 = [5 x i8] c"long\00"
@.str.5 = [6 x i8] c"%lld\0A\00"
@.str.6 = [6 x i8] c"float\00"
@.str.7 = [4 x i8] c"%f\0A\00"
@.str.8 = [7 x i8] c"double\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
%4 = alloca i32
%5 = alloca [10 x i8]
%6 = alloca i32
%7 = alloca i64
%8 = alloca double
store i32 0, i32* %1
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float* %2, i32* %3)
store i32 0, i32* %4
br label %10
10: ; preds = %54, %0
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %57
14: ; preds = %10
%15 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %15)
%17 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%18 = call i32 @strcmp(i8* %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%19 = icmp eq i32 %18, 1
br i1 %19, label %20, label %26
20: ; preds = %14
%21 = load float, float* %2
%22 = fptosi float %21 to i32
store i32 %22, i32* %6
%23 = load i32, i32* %6
%24 = sitofp i32 %23 to double
%25 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double %24)
br label %26
26: ; preds = %20, %14
%27 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%28 = call i32 @strcmp(i8* %27, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%29 = icmp eq i32 %28, 1
br i1 %29, label %30, label %36
30: ; preds = %26
%31 = load float, float* %2
%32 = fptosi float %31 to i64
store i64 %32, i64* %7
%33 = load i64, i64* %7
%34 = sitofp i64 %33 to double
%35 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), double %34)
br label %36
36: ; preds = %30, %26
%37 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%38 = call i32 @strcmp(i8* %37, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%39 = icmp eq i32 %38, 1
br i1 %39, label %40, label %44
40: ; preds = %36
%41 = load float, float* %2
%42 = fpext float %41 to double
%43 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), double %42)
br label %44
44: ; preds = %40, %36
%45 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%46 = call i32 @strcmp(i8* %45, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%47 = icmp eq i32 %46, 1
br i1 %47, label %48, label %53
48: ; preds = %44
%49 = load float, float* %2
%50 = fpext float %49 to double
store double %50, double* %8
%51 = load double, double* %8
%52 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), double %51)
br label %53
53: ; preds = %48, %44
br label %54
54: ; preds = %53
%55 = load i32, i32* %4
%56 = add nsw i32 %55, 1
store i32 %56, i32* %4
br label %10
57: ; preds = %10
%58 = load i32, i32* %1
ret i32 %58
}

LLVM IR (-O2):
@.str = [6 x i8] c"%f %d\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"int\00"
@.str.3 = [4 x i8] c"%d\0A\00"
@.str.4 = [5 x i8] c"long\00"
@.str.5 = [6 x i8] c"%lld\0A\00"
@.str.6 = [6 x i8] c"float\00"
@.str.7 = [4 x i8] c"%f\0A\00"
@.str.8 = [7 x i8] c"double\00"
define i32 @main() {
%1 = alloca float
%2 = alloca i32
%3 = alloca [10 x i8]
%4 = bitcast float* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float* %1, i32* %2)
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %47
9: ; preds = %0
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
br label %11
11: ; preds = %9, %43
%12 = phi i32 [ 0, %9 ], [ %44, %43 ]
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%14 = call i32 @strcmp(i8* %10, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %21
16: ; preds = %11
%17 = load float, float* %1
%18 = fptosi float %17 to i32
%19 = sitofp i32 %18 to double
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double %19)
br label %21
21: ; preds = %16, %11
%22 = call i32 @strcmp(i8* %10, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%23 = icmp eq i32 %22, 1
br i1 %23, label %24, label %29
24: ; preds = %21
%25 = load float, float* %1
%26 = fptosi float %25 to i64
%27 = sitofp i64 %26 to double
%28 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), double %27)
br label %29
29: ; preds = %24, %21
%30 = call i32 @strcmp(i8* %10, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%31 = icmp eq i32 %30, 1
br i1 %31, label %32, label %36
32: ; preds = %29
%33 = load float, float* %1
%34 = fpext float %33 to double
%35 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), double %34)
br label %36
36: ; preds = %32, %29
%37 = call i32 @strcmp(i8* %10, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%38 = icmp eq i32 %37, 1
br i1 %38, label %39, label %43
39: ; preds = %36
%40 = load float, float* %1
%41 = fpext float %40 to double
%42 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), double %41)
br label %43
43: ; preds = %39, %36
%44 = add nuw nsw i32 %12, 1
%45 = load i32, i32* %2
%46 = icmp slt i32 %44, %45
br i1 %46, label %11, label %47
47: ; preds = %43, %0
ret i32 0
}