#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 *, ...);
scalar_t__ reverseArr(float *, int);
char scanf(char *, ...);
int main(void) {
  int n;
  float arr[100];
  printf("Enter number of elements: ");
  scanf("%d", &n);
  for (size_t i = 0; i < n; i++) {
    if (scanf("%f", &arr[i]) != '\0')
      ;
    else {
      printf("Scan failed\n");
      goto end;
    }
  }
  if (reverseArr(arr, n)) {
    printf("The reverse number is:\n");
    for (size_t i = 0; i < n; i++) {
      printf("%.2f\n", arr[i]);
    }
  } else
    printf("Reverse failed");
end:
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movq   $0x0,-0x1a8(%rbp)
mov    -0x1a8(%rbp),%rax
movslq -0x8(%rbp),%rcx
cmp    %rcx,%rax
jae    11e4 <main+0xb4>
mov    -0x1a8(%rbp),%rax
lea    -0x1a0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
movsbl %al,%eax
cmp    $0x0,%eax
je     11b5 <main+0x85>
jmp    11c8 <main+0x98>
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    127b <main+0x14b>
jmp    11cd <main+0x9d>
mov    -0x1a8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x1a8(%rbp)
jmp    116d <main+0x3d>
lea    -0x1a0(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1050 <reverseArr@plt>
cmp    $0x0,%rax
je     1268 <main+0x138>
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movq   $0x0,-0x1b0(%rbp)
mov    -0x1b0(%rbp),%rax
movslq -0x8(%rbp),%rcx
cmp    %rcx,%rax
jae    1263 <main+0x133>
mov    -0x1b0(%rbp),%rax
movss  -0x1a0(%rbp,%rax,4),%xmm0
ff ff
cvtss2sd %xmm0,%xmm0
lea    0xe01(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x1b0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x1b0(%rbp)
jmp    1216 <main+0xe6>
jmp    1276 <main+0x146>
lea    0xddd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    127b <main+0x14b>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x1a8,%rsp
lea    0xeab(%rip),%rdi
xor    %r14d,%r14d
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb5(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
je     11b3 <main+0x73>
lea    0x10(%rsp),%r12
lea    0xe99(%rip),%r15
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
test   %al,%al
je     1214 <main+0xd4>
add    $0x1,%rbx
movslq 0xc(%rsp),%r14
add    $0x4,%r12
cmp    %r14,%rbx
jb     1190 <main+0x50>
lea    0x10(%rsp),%rdi
mov    %r14d,%esi
call   1060 <reverseArr@plt>
test   %rax,%rax
je     1222 <main+0xe2>
lea    0xe6a(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x0,0xc(%rsp)
je     1230 <main+0xf0>
xor    %ebx,%ebx
lea    0xe40(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movss  0x10(%rsp,%rbx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
cmp    %rax,%rbx
jb     11f0 <main+0xb0>
jmp    1230 <main+0xf0>
lea    0xe32(%rip),%rdi
call   1030 <puts@plt>
jmp    1230 <main+0xf0>
lea    0xdfe(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x1a8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Enter number of elements: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [13 x i8] c"Scan failed\0A\00"
@.str.4 = [24 x i8] c"The reverse number is:\0A\00"
@.str.5 = [6 x i8] c"%.2f\0A\00"
@.str.6 = [15 x i8] c"Reverse failed\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [100 x float]
%4 = alloca i64
%5 = alloca i64
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%7 = call signext i8 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
store i64 0, i64* %4
br label %8
8: ; preds = %23, %0
%9 = load i64, i64* %4
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = icmp ult i64 %9, %11
br i1 %12, label %13, label %26
13: ; preds = %8
%14 = load i64, i64* %4
%15 = getelementptr inbounds [100 x float], [100 x float]* %3, i64 0, i64 %14
%16 = call signext i8 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %15)
%17 = sext i8 %16 to i32
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %13
br label %22
20: ; preds = %13
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
br label %51
22: ; preds = %19
br label %23
23: ; preds = %22
%24 = load i64, i64* %4
%25 = add i64 %24, 1
store i64 %25, i64* %4
br label %8
26: ; preds = %8
%27 = getelementptr inbounds [100 x float], [100 x float]* %3, i64 0, i64 0
%28 = load i32, i32* %2
%29 = call i64 @reverseArr(float* %27, i32 %28)
%30 = icmp ne i64 %29, 0
br i1 %30, label %31, label %48
31: ; preds = %26
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
store i64 0, i64* %5
br label %33
33: ; preds = %44, %31
%34 = load i64, i64* %5
%35 = load i32, i32* %2
%36 = sext i32 %35 to i64
%37 = icmp ult i64 %34, %36
br i1 %37, label %38, label %47
38: ; preds = %33
%39 = load i64, i64* %5
%40 = getelementptr inbounds [100 x float], [100 x float]* %3, i64 0, i64 %39
%41 = load float, float* %40
%42 = fpext float %41 to double
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), double %42)
br label %44
44: ; preds = %38
%45 = load i64, i64* %5
%46 = add i64 %45, 1
store i64 %46, i64* %5
br label %33
47: ; preds = %33
br label %50
48: ; preds = %26
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
br label %50
50: ; preds = %48, %47
br label %51
51: ; preds = %50, %20
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Enter number of elements: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [3 x i8] c"%f\00"
@.str.5 = [6 x i8] c"%.2f\0A\00"
@.str.6 = [15 x i8] c"Reverse failed\00"
@str = [23 x i8] c"The reverse number is:\00"
@str.7 = [12 x i8] c"Scan failed\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x float]
%3 = bitcast i32* %1 to i8*
%4 = bitcast [100 x float]* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%6 = call signext i8 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, 0
br i1 %8, label %21, label %13
9: ; preds = %13
%10 = load i32, i32* %1
%11 = sext i32 %10 to i64
%12 = icmp ult i64 %18, %11
br i1 %12, label %13, label %21
13: ; preds = %0, %9
%14 = phi i64 [ %18, %9 ], [ 0, %0 ]
%15 = getelementptr inbounds [100 x float], [100 x float]* %2, i64 0, i64 %14
%16 = call signext i8 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %15)
%17 = icmp eq i8 %16, 0
%18 = add nuw i64 %14, 1
br i1 %17, label %19, label %9
19: ; preds = %13
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.7, i64 0, i64 0))
br label %42
21: ; preds = %9, %0
%22 = phi i32 [ 0, %0 ], [ %10, %9 ]
%23 = getelementptr inbounds [100 x float], [100 x float]* %2, i64 0, i64 0
%24 = call i64 @reverseArr(float* %23, i32 %22)
%25 = icmp eq i64 %24, 0
br i1 %25, label %40, label %26
26: ; preds = %21
%27 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%28 = load i32, i32* %1
%29 = icmp eq i32 %28, 0
br i1 %29, label %42, label %30
30: ; preds = %26, %30
%31 = phi i64 [ %36, %30 ], [ 0, %26 ]
%32 = getelementptr inbounds [100 x float], [100 x float]* %2, i64 0, i64 %31
%33 = load float, float* %32
%34 = fpext float %33 to double
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), double %34)
%36 = add nuw i64 %31, 1
%37 = load i32, i32* %1
%38 = sext i32 %37 to i64
%39 = icmp ult i64 %36, %38
br i1 %39, label %30, label %42
40: ; preds = %21
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
br label %42
42: ; preds = %30, %26, %19, %40
ret i32 0
}